@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 900;
    src: url("../fonts/IRANSansWeb_Black.eot");
    src: url("../fonts/IRANSansWeb_Black.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb_Black.woff2") format("woff2"), url("../fonts/IRANSansWeb_Black.woff") format("woff"), url("../fonts/IRANSansWeb_Black.ttf") format("truetype")
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/IRANSansWeb_Bold.eot");
    src: url("../fonts/IRANSansWeb_Bold.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb_Bold.woff2") format("woff2"), url("../fonts/IRANSansWeb_Bold.woff") format("woff"), url("../fonts/IRANSansWeb_Bold.ttf") format("truetype")
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 500;
    src: url("../fonts/IRANSansWeb_Medium.eot");
    src: url("../fonts/IRANSansWeb_Medium.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb_Medium.woff2") format("woff2"), url("../fonts/IRANSansWeb_Medium.woff") format("woff"), url("../fonts/IRANSansWeb_Medium.ttf") format("truetype")
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 300;
    src: url("../fonts/IRANSansWeb_Light.eot");
    src: url("../fonts/IRANSansWeb_Light.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb_Light.woff2") format("woff2"), url("../fonts/IRANSansWeb_Light.woff") format("woff"), url("../fonts/IRANSansWeb_Light.ttf") format("truetype")
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 200;
    src: url("../fonts/IRANSansWeb_UltraLight.eot");
    src: url("../fonts/IRANSansWeb_UltraLight.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb_UltraLight.woff2") format("woff2"), url("../fonts/IRANSansWeb_UltraLight.woff") format("woff"), url("../fonts/IRANSansWeb_UltraLight.ttf") format("truetype")
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/IRANSansWeb.eot");
    src: url("../fonts/IRANSansWeb.eot?#iefix") format("embedded-opentype"), url("../fonts/IRANSansWeb.woff2") format("woff2"), url("../fonts/IRANSansWeb.woff") format("woff"), url("../fonts/IRANSansWeb.ttf") format("truetype")
}

:lang(fa) {
    font-family: IRANSans !important;
}

:lang(en) {
    font-family: "Roboto", "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, Arial, sans-serif !important;
}

#branding {
    width: 60%;
    float: left;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 70px;
}

#branding h1#site-name {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    width: 100%;
    flex-wrap: wrap;
}

#branding .logo {
    display: block !important;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    margin: 0 !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#branding a:hover .logo {
    opacity: 0.8;
    transform: scale(1.05);
}

#branding a:active .logo {
    transform: scale(0.98);
}

.login #branding {
    width: 100%;
}

:lang(fa) #branding {
    float: right;
}

:lang(fa) #branding h1#site-name {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

/* Position logo to rightmost side in RTL */
:lang(fa) #branding h1#site-name > a,
[dir="rtl"] #branding h1#site-name > a {
    order: 999;
    margin-left: auto;
    margin-right: 0;
}

:lang(fa) #branding h1#site-name > .blocking-logo,
[dir="rtl"] #branding h1#site-name > .blocking-logo {
    order: 1;
    margin-right: auto;
    margin-left: 0;
}

.blocking-logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    white-space: normal !important;
    flex: 1;
    min-width: 0;
}

.blocking-logo .site-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: #f5dd5d;
    margin: 0;
}

.blocking-version {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

/* Use Vazir font for site title and version in RTL */
:lang(fa) .blocking-logo .site-title,
[dir="rtl"] .blocking-logo .site-title {
    font-family: 'Vazir', IRANSans, sans-serif !important;
}

:lang(fa) .blocking-logo .blocking-version,
[dir="rtl"] .blocking-logo .blocking-version {
    font-family: 'Vazir', IRANSans, sans-serif !important;
}

.startlink, .inlinestartlink {
    padding-right: 16px !important;
    background: url('/static/admin/img/icon-yes.svg') 0 1px no-repeat;
    background-position: right;
}

.startedlink {
    width: 30px;
    padding-right: 10px;
}

:lang(fa) .startedlink {
    padding-left: 10px;
}

:lang(fa) .startlink, .inlinestartlink {
    padding-left: 16px !important;
}

.admin-interface.login #header #branding h1 img.logo + span {
    margin-bottom: 5px;
    right: 0;
}

:lang(fa) .admin-interface.login #header #branding h1 img.logo + span {
    right: 50px;
    white-space: inherit;
    line-height: 20px;
    width: fit-content;
}

.i18n_flag {
    width: 26px;
    vertical-align: text-top;
}

.form-row.field-url div.readonly {
    direction: initial;
    text-align: -webkit-match-parent;
}

.aligned label {
    width: fit-content;
}

.fieldBox.field-box.field-row {
    width: auto;
}

.fieldBox.field-box.field-row div {
    margin: 0 75px;
}

.fieldBox.field-box.field-subject {
    width: auto;
}

.form-row.field-description div div {
    padding-right: 80px;
}

.errornote.loading-message.index {
    width: 100%;
}

.loading-message {
    width: auto;
    margin-right: 280px;
}

:lang(fa) .loading-message {
    margin-left: 280px;
    margin-right: 0;
}

:lang(fa) .admin-interface .paginator .this-page + a:not(.showall) {
    margin-left: auto;
}

.record-nav img {
    width: 28px;
    border: solid #4c70a6 2px;
    padding: 3px;
}

.container {
    position: relative;
    width: 100%;
}

.centered {
    text-align: center;
}

.center {
    margin: 5px auto;
    width: fit-content;
}

.submit-row a.closelink {
    float: right;
}

:lang(fa) .submit-row a.closelink {
    float: left;
}

/* Excel import buttons - ensure same height */
.excel-import-buttons input[type="submit"],
.excel-import-buttons .button,
.excel-import-buttons a.button {
    height: 35px;
    line-height: 35px;
    padding: 0 15px;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
}

.excel-import-buttons input[type="submit"] {
    padding: 0 15px;
    border: none;
    cursor: pointer;
}

.excel-import-buttons .button,
.excel-import-buttons a.button {
    text-decoration: none;
    text-align: center;
}

.admin-interface .submit-row input.close-enactment {
    margin: 0 5px;
}

.admin-interface .submit-row input.navigation {
    margin: 0 5px;
    height: 25px;
    line-height: 7px;
}

.admin-interface .submit-row div.close-enactment,
.admin-interface .submit-row div.navigation {
    float: left;
}

:lang(fa) .admin-interface .submit-row div.close-enactment,
:lang(fa) .admin-interface .submit-row div.navigation {
    float: right;
}

span.filtered {
    color: red;
}

p.datetime {
    margin-top: -8px !important;
}

.column-row, .field-row {
    width: 5%;
}

.column-type, .field-type {
    width: 5%;
}

.object-tools-print a {
    width: fit-content;
    text-align: center;
}

.object-tools-print {
    margin-right: 160px;
}

:lang(fa) .object-tools-print {
    margin-left: 160px;
}

.object-tools-print-detail {
    margin-right: 80px;
}

:lang(fa) .object-tools-print-detail {
    margin-left: 80px;
}

.custom-command {
    float: left;
    margin-top: -4px;
}

:lang(fa) .custom-command {
    float: right;
}

.row, .column {
    box-sizing: border-box;
}

.column {
    float: left;
    width: 50%;
    padding: 10px;
}

.row:after {
    content: "";
    display: table;
    clear: both;
}

.bordered {
    border-top: solid 1px #000;
    border-left: solid 1px #000;
}

:lang(fa) .bordered {
    border-left: 0;
    border-right: solid 1px #000;
}

:lang(fa) .bordered:last-child {
    border-left: 0;
}

.foot-note {
    padding: 20px;
    font-weight: bold;
}

.no-side-border {
    border-left: 0 !important;
}

:lang(fa) .no-side-border {
    border-right: 0 !important;
}

.no-top {
    border-top: 0;
}

.cancel-save {
    margin: 4px 8px 0 0;
}

.lookup, .lookup label {
    background-color: #f6f6f6;
    color: #000;
}

#stacked-container {
    width: 100%;
    height: 350px;
}

#stacked-inner {
    width: 100%;
    height: 100%;
}

.stacked-child {
    width: 50px;
    height: 50px;
    color: #fff;
    float: left;
}

.stacked-child-1 {
    width: 20%;
}

.stacked-child-2 {
    width: 80%;
    height: 100%;
    display: flex;
    flex-flow: column;
}

:lang(fa) .stacked-child {
    float: right;
}

#stacked-container #filter {
    margin: 0 20px 10px 0;
}

.stacked-vertical-child {
    width: 100%;
}

.stacked-vertical-child-1 {
    flex: 1;
}

.stacked-vertical-child-2 {
    flex: 1;
    overflow: auto;
    height: auto;
}

:lang(fa) .admin-interface.foldable-apps [class^="app-"].module > table > caption > a {
    margin-right: auto;
}
:lang(fa) .admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
    left: 0;
    right: auto;
}

.flex {
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    align-items: center;
}

.flex-2.chart {
    margin-right: -70px;
    margin-left: -70px;
}

.flex-2.chart > div {
    width: 40%;
    min-width: 250px;
    margin-right: 30px;
}

:lang(fa) .flex-2.chart > div {
    width: 40%;
    min-width: 250px;
    margin-left: 30px;
}

.flex-2.chart > div:last-child {
    width: 70%;
}

:lang(fa) .flex-2.chart > div:last-child {
    width: 70%;
}

.charts.full-screen {
    z-index: 1000;
    position: absolute;
    width: 100vw !important;
    height: 100vh !important;
    left: 0;
    top: 0;
    background: #fff;
}

.chart-container.full-screen {
    z-index: 10000;
    width: 95vw !important;
    height: 95vh !important;
    left: 0;
    top: 0;
    background: #fff;
    position: absolute;
}

.chart-container.full-screen .help {
    height: 100vh;
}

.result_list.full-screen {
    display: none;
}

@media (max-width: 1580px) {
    .flex.chart, :lang(fa) .flex.chart {
        flex-direction: column;
        align-items: center;
    }

    .flex-2.chart > div {
        width: 60% !important;
    }

    .flex-2.chart > div:last-child {
        width: 90% !important;
    }
}

@media (max-width: 1024px) {
    #personalinquiry_form .fieldBox.field-box {
        float: right;
        margin-left: 40px;
        border-top: 0;
    }

    .stacked-child-1, .stacked-child-2 {
        flex: 1;
        width: 100%;
    }

    .stacked-child-1 {
        height: 200px;
    }

    #stacked-inner {
        height: 100%;
        display: flex;
        flex-flow: column;
    }

    #stacked-container {
        height: auto;
    }
}

@media (max-width: 870px) {
    .flex {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .flex-2 > div {
        width: 80%;
        margin: 30px;
    }
}

@media (max-width: 550px) {
    #personalinquiry_form .fieldBox.field-box {
        float: none;
        width: 100% !important;
        margin: 0 -10px;
        padding: 0 10px;
    }
}

/* Fix admin index page layout - ensure recent actions module appears in sidebar at top level */
/* Only apply to index page, not dashboard or other pages */
body.index:not(.dashboard) #content {
    display: grid !important;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
    grid-auto-rows: min-content;
}

:lang(fa) body.index:not(.dashboard) #content {
    grid-template-columns: 300px 1fr;
}

/* #monitoring div - first row, first column, aligned to top */
body.index:not(.dashboard) #content > #monitoring {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-self: start !important;
}

:lang(fa) body.index:not(.dashboard) #content > #monitoring {
    grid-column: 2;
    grid-row: 1;
}

/* Recent actions module - first row, second column, aligned to top with #monitoring */
body.index:not(.dashboard) #content > .colSM,
body.index:not(.dashboard) #content > .recent-actions-module,
body.index:not(.dashboard) #content > .module.recent-actions,
body.index:not(.dashboard) #content > div[class*="recent"],
body.index:not(.dashboard) #content > div.module:has(table caption a[href*="recent"]) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    clear: none !important;
    float: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-self: start !important;
    vertical-align: top !important;
}

:lang(fa) body.index:not(.dashboard) #content > .colSM,
:lang(fa) body.index:not(.dashboard) #content > .recent-actions-module,
:lang(fa) body.index:not(.dashboard) #content > .module.recent-actions,
:lang(fa) body.index:not(.dashboard) #content > div[class*="recent"],
:lang(fa) body.index:not(.dashboard) #content > div.module:has(table caption a[href*="recent"]) {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

/* App modules - continue in first column, below #monitoring */
body.index:not(.dashboard) #content > div:not(.colSM):not(.recent-actions-module):not(.module.recent-actions):not([class*="recent"]):not(#monitoring) {
    grid-column: 1;
    width: 100%;
    margin-top: 0;
}

:lang(fa) body.index:not(.dashboard) #content > div:not(.colSM):not(.recent-actions-module):not(.module.recent-actions):not([class*="recent"]):not(#monitoring) {
    grid-column: 2;
}

/* Ensure recent actions module doesn't shift below */
body.index:not(.dashboard) .recent-actions-module,
body.index:not(.dashboard) .module.recent-actions {
    clear: none !important;
    float: none !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix module layout on index page */
body.index:not(.dashboard) #content .module {
    margin-bottom: 20px;
    width: 100%;
}

/* Ensure #monitoring module has no top spacing that would misalign it */
body.index:not(.dashboard) #content > #monitoring .module {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Responsive Header Styles - Tablet */
@media (max-width: 992px) and (min-width: 769px) {
    /* Hide logo in tablet mode */
    #branding .logo {
        display: none !important;
    }
}

/* Fallback for mobile or if grid doesn't work */
@media (max-width: 768px) {
    body.index:not(.dashboard) #content {
        display: flex !important;
        flex-direction: column;
    }
    
    body.index:not(.dashboard) #content > .colSM,
    body.index:not(.dashboard) #content > .recent-actions-module,
    body.index:not(.dashboard) #content > .module.recent-actions,
    body.index:not(.dashboard) #content > div[class*="recent"] {
        width: 100% !important;
        grid-column: 1 !important;
    }
}

/* User Links Wrapper */
.user-links-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 25px;
    line-height: 1.6;
}

/* Hamburger Menu Button - Hidden by default */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: fixed;
    top: 15px;
    right: 15px;
    will-change: width, height, background-color;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* RTL: Position hamburger menu at top left */
:lang(fa) .mobile-menu-toggle,
[dir="rtl"] .mobile-menu-toggle {
    right: auto;
    left: 15px;
}

/* LTR: Position hamburger menu at top right */
:lang(en) .mobile-menu-toggle,
[dir="ltr"] .mobile-menu-toggle {
    left: auto;
    right: 15px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transform-origin: center;
}

.mobile-menu-toggle.active {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    background-color: #1e3a8afa !important;
    padding: 15px 20px;
    height: auto;
    min-height: 60px;
    justify-content: center;
    align-items: center;
    border-radius: 0;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide hamburger lines when active */
.mobile-menu-toggle.active span {
    display: none;
}

/* Show X sign when active - positioned at original button location */
.mobile-menu-toggle.active::before {
    content: '×';
    display: block !important;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    font-weight: 300;
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 1 !important;
    visibility: visible !important;
}

/* RTL: Position X at top left */
:lang(fa) .mobile-menu-toggle.active::before,
[dir="rtl"] .mobile-menu-toggle.active::before {
    right: auto;
    left: 15px;
}

/* LTR: Position X at top right */
:lang(en) .mobile-menu-toggle.active::before,
[dir="ltr"] .mobile-menu-toggle.active::before {
    left: auto;
    right: 15px;
}

/* Desktop User Links - Visible by default */
.user-links-desktop {
    display: inline-block;
    white-space: nowrap;
    line-height: 1.6;
}

.user-links-desktop a {
    white-space: nowrap;
    display: inline;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1.5;
    vertical-align: middle;
}

.user-links-desktop a:hover {
    color: #f5dd5d;
    background-color: rgba(245, 221, 93, 0.1);
    transform: translateY(-1px);
}

.user-links-desktop a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #f5dd5d;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.user-links-desktop a:hover::after {
    width: 80%;
}

.user-links-desktop form a:hover {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.user-links-desktop form a:hover::after {
    background-color: #ff6b6b;
}

/* Mobile Menu Dropdown - Hidden by default */
.mobile-menu-dropdown {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(30, 58, 138, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu-dropdown.active {
    display: block;
    max-height: 400px;
    top: 60px;
}

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu-item {
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.mobile-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item .i18n_flag {
    width: 24px;
    height: auto;
}

/* Mobile Styles - Below 1028px */
@media (max-width: 1028px) {
    /* Show hamburger button */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide desktop links */
    .user-links-desktop {
        display: none !important;
    }
    
    /* Ensure mobile menu is positioned correctly */
    .mobile-menu-dropdown {
        top: 60px;
    }
}