﻿:root {
    --blue: #0b3b8c;
    --blue2: #0f5fd1;
    --light: #f4f8ff;
    --border: #c8d8f5;
    --text: #1f2937;
    --muted: #64748b;
    --danger: #dc2626;
    --success: #15803d;
    --card: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #eef5ff 0%, #ffffff 45%, #eef7f3 100%);
    color: var(--text);
}

a { text-decoration: none; }

.topbar {
    height: 70px;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
}

.brand {
    font-size: 24px;
    font-weight: 800;
}

.topbar nav {
    display: flex;
    gap: 12px;
}

.topbar nav a {
    color: #fff;
    background: rgba(255,255,255,.13);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.container {
    max-width: 1420px;
    margin: 26px auto;
    padding: 0 20px 45px;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #dbeafe, #f8fafc 55%, #eaf7ff);
}

.login-card {
    width: 440px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 24px 50px rgba(11,59,140,.18);
}

.login-card h1 {
    color: var(--blue);
    margin: 0 0 8px;
    text-align: center;
    font-size: 30px;
}

.login-card p {
    text-align: center;
    margin: 0 0 24px;
    color: var(--muted);
    font-weight: 700;
}

label {
    display: block;
    margin: 12px 0 7px;
    font-weight: 800;
    color: var(--blue);
}

input, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 13px;
    background: #fff;
    outline: none;
    font-size: 15px;
}

select[multiple] {
    min-height: 160px;
}

button, .btn {
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover { background: var(--blue2); }

.btn.secondary { background: #475569; }
.btn.danger, button.danger { background: var(--danger); }
.btn.success { background: var(--success); }

.alert {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.page-title {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.page-title h1 {
    margin: 0;
    color: var(--blue);
    font-size: 34px;
}

.page-title p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.filters, .panel, .upload-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 12px 25px rgba(15,23,42,.07);
}

.filters form {
    display: flex;
    gap: 12px;
    align-items: end;
    max-width: 420px;
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.branch-card {
    background: #fff;
    border: 2px dashed #78a6ec;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 25px rgba(15,23,42,.07);
}

.branch-card h2 {
    margin: 0;
    color: var(--blue);
    font-size: 24px;
}

.branch-card p {
    margin: 5px 0 16px;
    color: var(--muted);
    font-weight: 700;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--blue);
    font-weight: 800;
    border-radius: 14px;
    padding: 12px;
}

.category-item:hover {
    border-color: var(--blue2);
    background: #eaf2ff;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.month-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    color: var(--blue);
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 12px 25px rgba(15,23,42,.07);
}

.toolbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.upload-box form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.table-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 25px rgba(15,23,42,.07);
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--blue);
    color: #fff;
    padding: 14px;
    text-align: right;
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

tr:hover td { background: #f8fbff; }

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    min-width: 220px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.checks {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.checks label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--light);
    padding: 10px 12px;
    border-radius: 12px;
    margin: 0;
}

.checks input { width: auto; }

.empty {
    padding: 24px;
    border-radius: 18px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 900;
    border: 1px solid #fed7aa;
}

.user-edit-card {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

@media (max-width: 1100px) {
    .branches-grid { grid-template-columns: repeat(2, 1fr); }
    .months-grid { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .branches-grid, .months-grid { grid-template-columns: 1fr; }

    .topbar {
        height: auto;
        padding: 18px;
        flex-direction: column;
        gap: 12px;
    }

    .filters form, .upload-box form {
        display: block;
    }
}


/* Bilingual direction support */
html[dir="ltr"] body {
    direction: ltr;
}

html[dir="ltr"] th,
html[dir="ltr"] td {
    text-align: left;
}

html[dir="ltr"] .topbar {
    direction: ltr;
}

html[dir="ltr"] .filters form,
html[dir="ltr"] .upload-box form,
html[dir="ltr"] .inline-form,
html[dir="ltr"] .actions {
    direction: ltr;
}

html[dir="ltr"] label {
    text-align: left;
}

html[dir="rtl"] label {
    text-align: right;
}


/* Urdu language support */
html[lang="ur"] body {
    direction: rtl;
    font-family: "Segoe UI", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Tahoma, Arial, sans-serif;
}

html[lang="ur"] th,
html[lang="ur"] td,
html[lang="ur"] label {
    text-align: right;
}


/* Language dropdown */
.language-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.login-language-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
}

.language-select {
    width: auto;
    min-width: 125px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.45);
    background: #ffffff;
    color: #0b3b8c;
    font-weight: 800;
    cursor: pointer;
}

.login-language-select {
    width: 170px;
    border: 1px solid var(--border);
}

.language-submit {
    display: none;
}

@media (max-width: 700px) {
    .language-form {
        width: 100%;
        justify-content: center;
    }

    .language-select {
        width: 100%;
    }
}


/* Clean modern login page */
.clean-login {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(59,130,246,.25), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(20,184,166,.20), transparent 28%),
        linear-gradient(135deg, #eff6ff 0%, #ffffff 45%, #eefdf7 100%);
}

.login-shell {
    width: min(1050px, 94vw);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(200,216,245,.9);
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
    backdrop-filter: blur(16px);
}

.login-info-panel {
    position: relative;
    padding: 58px 52px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(11,59,140,.96), rgba(15,95,209,.92)),
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 25%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-info-panel::after {
    content: "";
    position: absolute;
    inset: auto -70px -70px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
}

.login-logo {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.28);
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.login-info-panel h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -.5px;
}

.login-subtitle {
    margin: 16px 0 28px;
    font-size: 17px;
    line-height: 1.8;
    color: rgba(255,255,255,.86);
    max-width: 520px;
}

.login-security-list {
    display: grid;
    gap: 12px;
    max-width: 440px;
}

.login-security-list div {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    padding: 13px 16px;
    border-radius: 16px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.clean-card {
    width: auto;
    border: 0;
    border-radius: 0;
    padding: 58px 50px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-card-header {
    margin-bottom: 24px;
}

.login-card-header h2 {
    margin: 0;
    color: var(--blue);
    font-size: 34px;
    font-weight: 900;
}

.login-card-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
    text-align: inherit;
}

.modern-login-form label {
    margin-top: 16px;
}

.modern-login-form input {
    height: 52px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #d7e4fb;
    transition: .18s ease;
}

.modern-login-form input:focus {
    border-color: var(--blue2);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.login-main-btn {
    width: 100%;
    height: 52px;
    margin-top: 24px;
    border-radius: 16px;
    font-size: 16px;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    box-shadow: 0 14px 28px rgba(15,95,209,.24);
}

.login-footer-note {
    margin-top: 22px;
    padding: 14px 16px;
    text-align: center;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    border: 1px solid #e2e8f0;
}

html[dir="rtl"] .login-card-header p,
html[dir="rtl"] .login-footer-note {
    text-align: right;
}

html[dir="ltr"] .login-card-header p,
html[dir="ltr"] .login-footer-note {
    text-align: left;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-info-panel {
        padding: 38px 30px;
    }

    .clean-card {
        padding: 38px 30px;
    }

    .login-info-panel h1 {
        font-size: 30px;
    }
}

@media (max-width: 520px) {
    .login-shell {
        width: 94vw;
        border-radius: 24px;
    }

    .login-info-panel {
        padding: 30px 22px;
    }

    .clean-card {
        padding: 30px 22px;
    }

    .login-logo {
        width: 66px;
        height: 66px;
        border-radius: 18px;
        font-size: 24px;
    }

    .login-card-header h2 {
        font-size: 28px;
    }
}
/* Professional animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softScale {
    from {
        opacity: 0;
        transform: scale(.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatIcon {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
    100% {
        transform: translateY(0);
    }
}

body {
    animation: fadeIn .35s ease-in-out;
}

.topbar {
    animation: slideDown .45s ease both;
}

.container {
    animation: slideUp .45s ease both;
}

.page-title,
.filters,
.panel,
.upload-box,
.table-card,
.branch-card,
.month-card {
    animation: slideUp .45s ease both;
}

.branch-card:nth-child(1) { animation-delay: .03s; }
.branch-card:nth-child(2) { animation-delay: .06s; }
.branch-card:nth-child(3) { animation-delay: .09s; }
.branch-card:nth-child(4) { animation-delay: .12s; }
.branch-card:nth-child(5) { animation-delay: .15s; }
.branch-card:nth-child(6) { animation-delay: .18s; }
.branch-card:nth-child(7) { animation-delay: .21s; }
.branch-card:nth-child(8) { animation-delay: .24s; }

.month-card:nth-child(1) { animation-delay: .03s; }
.month-card:nth-child(2) { animation-delay: .06s; }
.month-card:nth-child(3) { animation-delay: .09s; }
.month-card:nth-child(4) { animation-delay: .12s; }
.month-card:nth-child(5) { animation-delay: .15s; }
.month-card:nth-child(6) { animation-delay: .18s; }
.month-card:nth-child(7) { animation-delay: .21s; }
.month-card:nth-child(8) { animation-delay: .24s; }
.month-card:nth-child(9) { animation-delay: .27s; }
.month-card:nth-child(10) { animation-delay: .30s; }
.month-card:nth-child(11) { animation-delay: .33s; }
.month-card:nth-child(12) { animation-delay: .36s; }

.branch-card,
.month-card,
.category-item,
.btn,
button,
.user-edit-card,
.login-security-list div {
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease,
        background .22s ease,
        opacity .22s ease;
}

.branch-card:hover,
.month-card:hover,
.user-edit-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .13);
}

.category-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
}

html[dir="ltr"] .category-item:hover {
    transform: translateX(4px);
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 95, 209, .18);
}

button:active,
.btn:active {
    transform: translateY(0) scale(.98);
}

table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

table tbody tr:hover {
    transform: scale(1.004);
}

input,
select {
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        transform .18s ease;
}

input:focus,
select:focus {
    border-color: var(--blue2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
    transform: translateY(-1px);
}

.login-shell {
    animation: softScale .55s ease both;
}

.login-logo {
    animation: floatIcon 3.2s ease-in-out infinite;
}

.login-info-panel h1,
.login-subtitle,
.login-security-list,
.clean-card {
    animation: slideUp .55s ease both;
}

.login-info-panel h1 {
    animation-delay: .08s;
}

.login-subtitle {
    animation-delay: .14s;
}

.login-security-list {
    animation-delay: .20s;
}

.clean-card {
    animation-delay: .12s;
}

.login-main-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 35px rgba(15, 95, 209, .28);
}

.alert {
    animation: softScale .25s ease both;
}

.empty {
    animation: softScale .35s ease both;
}

/* Safer motion setting */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* Mobile responsive design */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #eef5ff 0%, #ffffff 55%, #eef7f3 100%);
        overflow-x: hidden;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        height: auto;
        padding: 14px 14px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .brand {
        font-size: 18px;
        text-align: center;
        line-height: 1.4;
    }

    .topbar nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .topbar nav a {
        padding: 10px 8px;
        font-size: 13px;
        text-align: center;
        border-radius: 12px;
        white-space: nowrap;
    }

    .language-form {
        grid-column: 1 / -1;
        width: 100%;
    }

    .language-select {
        width: 100%;
        min-width: 100%;
        height: 42px;
        text-align: center;
        font-size: 14px;
    }

    .container {
        width: 100%;
        margin: 14px auto;
        padding: 0 12px 35px;
    }

    .page-title {
        border-radius: 18px;
        padding: 18px 16px;
        margin-bottom: 14px;
    }

    .page-title h1 {
        font-size: 23px;
        line-height: 1.35;
        word-break: break-word;
    }

    .page-title p {
        font-size: 13px;
        line-height: 1.6;
    }

    .filters,
    .panel,
    .upload-box,
    .toolbar {
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 14px;
    }

    .filters form {
        display: grid;
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 10px;
    }

    input,
    select,
    button,
    .btn {
        min-height: 44px;
        font-size: 15px;
    }

    .branches-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .branch-card {
        border-radius: 18px;
        padding: 16px;
    }

    .branch-card h2 {
        font-size: 21px;
    }

    .category-item {
        padding: 13px;
        font-size: 15px;
    }

    .months-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .month-card {
        padding: 18px 12px;
        font-size: 18px;
        border-radius: 16px;
    }

    .month-toolbar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .month-toolbar .btn {
        width: 100%;
        padding: 10px 6px;
        font-size: 13px;
    }

    .upload-box form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .upload-box input[type="file"] {
        width: 100%;
        padding: 11px;
        background: #f8fbff;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    select[multiple] {
        min-height: 135px;
    }

    .checks {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .checks label {
        width: 100%;
        justify-content: flex-start;
        padding: 12px;
    }

    .user-edit-card {
        border-radius: 16px;
        padding: 13px;
    }

    .table-card {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 18px;
        margin-bottom: 14px;
        padding: 12px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .responsive-table tr:hover {
        transform: none;
    }

    .responsive-table td {
        border: 0;
        border-bottom: 1px solid #edf2f7;
        padding: 11px 4px;
        display: grid;
        grid-template-columns: 42% 58%;
        gap: 10px;
        align-items: start;
        font-size: 14px;
        word-break: break-word;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 900;
        color: var(--blue);
        font-size: 13px;
        line-height: 1.5;
    }

    .responsive-table td.empty {
        display: block;
        text-align: center;
        padding: 18px;
    }

    .responsive-table td.empty::before {
        display: none;
    }

    .actions,
    .mobile-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .actions .btn,
    .actions button,
    .mobile-actions .btn,
    .mobile-actions button {
        width: 100%;
        text-align: center;
    }

    .inline-form,
    .mobile-inline-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .inline-form input,
    .mobile-inline-form input {
        min-width: 0;
        width: 100%;
    }

    .login-shell {
        width: 94vw;
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 24px;
        margin: 18px 0;
    }

    .login-info-panel {
        padding: 30px 24px;
        min-height: auto;
    }

    .login-logo {
        width: 62px;
        height: 62px;
        border-radius: 18px;
        font-size: 23px;
        margin-bottom: 18px;
    }

    .login-info-panel h1 {
        font-size: 25px;
        line-height: 1.35;
    }

    .login-subtitle {
        font-size: 14px;
        line-height: 1.7;
        margin: 12px 0 18px;
    }

    .login-security-list {
        gap: 8px;
    }

    .login-security-list div {
        padding: 11px 12px;
        font-size: 13px;
        border-radius: 13px;
    }

    .clean-card {
        padding: 28px 22px;
    }

    .login-card-header h2 {
        font-size: 27px;
    }

    .login-card-header p {
        font-size: 13px;
    }

    .login-footer-note {
        font-size: 12px;
        line-height: 1.6;
    }
}

@media (max-width: 420px) {
    .topbar nav {
        grid-template-columns: 1fr;
    }

    .months-grid {
        grid-template-columns: 1fr;
    }

    .month-toolbar {
        grid-template-columns: repeat(2, 1fr);
    }

    .responsive-table td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .responsive-table td::before {
        margin-bottom: 2px;
    }

    .page-title h1 {
        font-size: 21px;
    }
}

/* Better touch behavior */
@media (hover: none) and (pointer: coarse) {
    .branch-card:hover,
    .month-card:hover,
    .user-edit-card:hover,
    button:hover,
    .btn:hover {
        transform: none;
    }

    .category-item:hover {
        transform: none;
    }
}


/* Sara Tech logo and copyright */
.brand-with-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.footer-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.site-footer {
    margin-top: 20px;
    padding: 0 20px 28px;
}

.footer-inner {
    max-width: 1420px;
    margin: 0 auto;
    background: rgba(255,255,255,.82);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-weight: 800;
    box-shadow: 0 12px 25px rgba(15,23,42,.06);
    backdrop-filter: blur(10px);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--blue);
    font-weight: 900;
}

.footer-copy {
    font-size: 14px;
}

.login-logo-box {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.28);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    animation: floatIcon 3.2s ease-in-out infinite;
}

.login-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

.login-form-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin-bottom: 16px;
    background: #f8fbff;
    border: 1px solid #d7e4fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-logo img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.login-copyright {
    margin-top: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 768px) {
    .brand-with-logo {
        justify-content: center;
        flex-direction: column;
        gap: 6px;
    }

    .site-logo {
        width: 42px;
        height: 42px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .footer-copy {
        font-size: 12px;
        line-height: 1.6;
    }

    .login-logo-box {
        width: 76px;
        height: 76px;
        border-radius: 22px;
        margin-bottom: 18px;
    }

    .login-logo-img {
        width: 56px;
        height: 56px;
        border-radius: 17px;
    }

    .login-form-logo {
        margin-left: auto;
        margin-right: auto;
    }
}


/* Real Sara Tech logo layout */
.login-logo-box {
    width: 300px;
    height: 185px;
    max-width: 100%;
    background: rgba(255,255,255,.96);
    padding: 18px;
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.site-logo,
.footer-logo,
.login-form-logo img {
    object-fit: contain;
}

@media (max-width: 768px) {
    .login-logo-box {
        width: 240px;
        height: 150px;
        margin-left: auto;
        margin-right: auto;
    }
}


/* Sara Tech AI logo color theme */
:root {
    --blue: #102536;
    --blue2: #12d6a0;
    --light: #eafff8;
    --border: #b7efe0;
    --text: #102536;
    --muted: #5f7280;
    --danger: #dc2626;
    --success: #10b981;
    --card: #ffffff;

    --sara-navy: #102536;
    --sara-navy-dark: #071923;
    --sara-teal: #12d6a0;
    --sara-teal-dark: #0aa77d;
    --sara-mint: #eafff8;
}

/* Main background */
body {
    background:
        radial-gradient(circle at 15% 8%, rgba(18, 214, 160, .18), transparent 28%),
        radial-gradient(circle at 90% 75%, rgba(16, 37, 54, .10), transparent 28%),
        linear-gradient(135deg, #f7fffc 0%, #ffffff 45%, #eafff8 100%);
    color: var(--sara-navy);
}

/* Header */
.topbar {
    background:
        linear-gradient(135deg, var(--sara-navy-dark), var(--sara-navy) 55%, var(--sara-teal-dark));
    box-shadow: 0 12px 32px rgba(7, 25, 35, .22);
}

.topbar nav a {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
}

.topbar nav a:hover {
    background: rgba(18,214,160,.22);
}

/* Buttons */
button,
.btn {
    background: linear-gradient(135deg, var(--sara-navy), var(--sara-teal-dark));
    color: #ffffff;
}

button:hover,
.btn:hover {
    background: linear-gradient(135deg, var(--sara-teal-dark), var(--sara-teal));
    color: #ffffff;
}

.btn.secondary {
    background: #475569;
}

.btn.success {
    background: linear-gradient(135deg, var(--sara-teal-dark), var(--sara-teal));
}

/* Page title */
.page-title {
    border-color: rgba(18,214,160,.35);
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(234,255,248,.88));
}

.page-title h1 {
    color: var(--sara-navy);
}

/* Cards */
.branch-card,
.month-card,
.panel,
.filters,
.upload-box,
.table-card,
.user-edit-card {
    border-color: rgba(18,214,160,.32);
    box-shadow: 0 14px 30px rgba(7, 25, 35, .08);
}

.branch-card {
    border: 2px dashed rgba(18,214,160,.72);
}

.branch-card h2,
.month-card,
label {
    color: var(--sara-navy);
}

/* Category links */
.category-item {
    background: linear-gradient(135deg, #f2fffb, #ffffff);
    border-color: rgba(18,214,160,.38);
    color: var(--sara-navy);
}

.category-item:hover {
    background: linear-gradient(135deg, rgba(18,214,160,.14), #ffffff);
    border-color: var(--sara-teal);
}

/* Tables */
th {
    background: linear-gradient(135deg, var(--sara-navy-dark), var(--sara-navy));
    color: #ffffff;
}

tr:hover td {
    background: #f2fffb;
}

/* Inputs */
input,
select {
    border-color: rgba(18,214,160,.35);
}

input:focus,
select:focus {
    border-color: var(--sara-teal);
    box-shadow: 0 0 0 4px rgba(18,214,160,.16);
}

/* Login page */
.clean-login {
    background:
        radial-gradient(circle at 20% 10%, rgba(18,214,160,.24), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(16,37,54,.18), transparent 28%),
        linear-gradient(135deg, #f6fffc 0%, #ffffff 45%, #eafff8 100%);
}

.login-info-panel {
    background:
        linear-gradient(135deg, rgba(7,25,35,.98), rgba(16,37,54,.96) 58%, rgba(10,167,125,.92)),
        radial-gradient(circle at 30% 20%, rgba(18,214,160,.28), transparent 25%);
}

.login-security-list div {
    background: rgba(18,214,160,.13);
    border-color: rgba(18,214,160,.30);
}

.login-main-btn {
    background: linear-gradient(135deg, var(--sara-navy), var(--sara-teal-dark));
    box-shadow: 0 14px 30px rgba(18,214,160,.22);
}

.login-main-btn:hover {
    background: linear-gradient(135deg, var(--sara-teal-dark), var(--sara-teal));
    box-shadow: 0 18px 40px rgba(18,214,160,.32);
}

.login-card-header h2 {
    color: var(--sara-navy);
}

.login-footer-note {
    background: #f2fffb;
    border-color: rgba(18,214,160,.28);
}

/* Logo containers */
.site-logo,
.footer-logo,
.login-form-logo,
.login-logo-box {
    border-color: rgba(18,214,160,.35);
}

/* Footer */
.footer-inner {
    background: rgba(255,255,255,.88);
    border-color: rgba(18,214,160,.34);
}

.footer-brand {
    color: var(--sara-navy);
}

/* Language dropdown */
.language-select {
    color: var(--sara-navy);
    border-color: rgba(18,214,160,.45);
}

/* Mobile header */
@media (max-width: 768px) {
    .topbar {
        background:
            linear-gradient(135deg, var(--sara-navy-dark), var(--sara-navy) 60%, var(--sara-teal-dark));
    }

    .responsive-table tr {
        border-color: rgba(18,214,160,.32);
    }

    .responsive-table td::before {
        color: var(--sara-navy);
    }
}


/* Login logo cleanup and larger left logo */
.login-card-header {
    text-align: inherit;
}

.login-form-logo {
    display: none !important;
}

.login-logo-box {
    width: 390px !important;
    height: 240px !important;
    max-width: 100%;
    padding: 22px !important;
    border-radius: 34px !important;
}

.login-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

@media (max-width: 900px) {
    .login-logo-box {
        width: 320px !important;
        height: 200px !important;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 520px) {
    .login-logo-box {
        width: 270px !important;
        height: 170px !important;
        padding: 16px !important;
    }
}


/* Compact and clean login layout */
.compact-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.compact-login-shell {
    width: min(880px, 94vw) !important;
    min-height: 500px !important;
    grid-template-columns: .92fr 1fr !important;
    border-radius: 28px !important;
}

.compact-login-info {
    padding: 42px 38px !important;
    align-items: center;
    text-align: center;
}

.compact-login-logo-box {
    width: 300px !important;
    height: 185px !important;
    padding: 18px !important;
    border-radius: 28px !important;
    margin: 0 auto 22px !important;
}

.compact-login-info h1 {
    font-size: 28px !important;
    line-height: 1.35 !important;
    max-width: 380px;
}

.compact-login-subtitle {
    font-size: 14px !important;
    line-height: 1.7 !important;
    margin: 12px auto 0 !important;
    max-width: 360px;
    color: rgba(255,255,255,.82) !important;
}

.login-security-list {
    display: none !important;
}

.compact-login-card {
    padding: 44px 42px !important;
}

.compact-login-header {
    margin-bottom: 20px !important;
}

.compact-login-header h2 {
    font-size: 30px !important;
    margin-bottom: 6px !important;
}

.compact-login-header p {
    font-size: 14px !important;
    color: var(--muted);
    margin-top: 4px !important;
}

.compact-login-card .modern-login-form label {
    margin-top: 13px !important;
    font-size: 14px;
}

.compact-login-card .modern-login-form input {
    height: 48px !important;
    border-radius: 14px !important;
}

.compact-login-card .login-main-btn {
    height: 48px !important;
    margin-top: 22px !important;
    border-radius: 14px !important;
}

.compact-login-note {
    margin-top: 18px !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
}

.compact-login-card .login-copyright {
    margin-top: 14px !important;
    font-size: 12px !important;
}

/* RTL/LTR clean alignment */
html[dir="rtl"] .compact-login-header,
html[dir="rtl"] .compact-login-note {
    text-align: right;
}

html[dir="ltr"] .compact-login-header,
html[dir="ltr"] .compact-login-note {
    text-align: left;
}

@media (max-width: 900px) {
    .compact-login {
        padding: 16px;
    }

    .compact-login-shell {
        grid-template-columns: 1fr !important;
        width: min(520px, 94vw) !important;
        min-height: auto !important;
    }

    .compact-login-info {
        padding: 30px 24px !important;
    }

    .compact-login-logo-box {
        width: 250px !important;
        height: 155px !important;
        margin-bottom: 16px !important;
    }

    .compact-login-info h1 {
        font-size: 24px !important;
    }

    .compact-login-subtitle {
        font-size: 13px !important;
    }

    .compact-login-card {
        padding: 30px 24px !important;
    }

    .compact-login-header h2 {
        font-size: 26px !important;
    }
}

@media (max-width: 520px) {
    .compact-login-shell {
        border-radius: 22px !important;
    }

    .compact-login-logo-box {
        width: 220px !important;
        height: 138px !important;
        padding: 14px !important;
    }

    .compact-login-info {
        padding: 26px 18px !important;
    }

    .compact-login-card {
        padding: 26px 18px !important;
    }
}


/* Arabic / English Login Page */
.bilingual-login-page {
    direction: rtl;
}

.bilingual-login-shell {
    direction: rtl;
}

.bilingual-login-header {
    text-align: right !important;
}

.bilingual-login-header h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
    color: var(--sara-navy);
}

.bilingual-login-header h3 {
    margin: 3px 0 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--sara-teal-dark);
}

.bilingual-login-header p {
    margin: 3px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.bilingual-login-form label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: var(--sara-navy);
}

.bilingual-login-form label span {
    font-weight: 900;
}

.bilingual-login-form label small {
    font-size: 12px;
    color: var(--sara-teal-dark);
    font-weight: 900;
    direction: ltr;
}

.bilingual-login-form input {
    direction: ltr;
    text-align: left;
}

.bilingual-login-note {
    text-align: center !important;
    line-height: 1.8;
}

.compact-login-info h3 {
    margin: 8px 0 0;
    color: rgba(255,255,255,.86);
    font-size: 20px;
    font-weight: 800;
}

@media (max-width: 768px) {
    .bilingual-login-header {
        text-align: center !important;
    }

    .bilingual-login-form label {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .bilingual-login-note {
        font-size: 12px !important;
    }
}


/* Login follows selected session language */
.session-lang-login-header h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
    color: var(--sara-navy);
}

.session-lang-login-header p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}

.session-lang-login-form input {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .session-lang-login-header {
    text-align: right !important;
}

html[dir="ltr"] .session-lang-login-header {
    text-align: left !important;
}

html[dir="rtl"] .compact-login-note {
    text-align: right !important;
}

html[dir="ltr"] .compact-login-note {
    text-align: left !important;
}

html[lang="ur"] .session-lang-login-header,
html[lang="ur"] .compact-login-note {
    font-family: "Segoe UI", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Tahoma, Arial, sans-serif;
}

@media (max-width: 768px) {
    html[dir="rtl"] .session-lang-login-header,
    html[dir="ltr"] .session-lang-login-header,
    html[dir="rtl"] .compact-login-note,
    html[dir="ltr"] .compact-login-note {
        text-align: center !important;
    }
}


/* My Files Dashboard */
.my-files-quick-card {
    margin-bottom: 18px;
    padding: 20px 22px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(234,255,248,.9));
    border: 1px solid rgba(18,214,160,.34);
    box-shadow: 0 14px 30px rgba(7,25,35,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.my-files-quick-card h2 {
    margin: 0 0 6px;
    color: var(--sara-navy);
    font-size: 24px;
    font-weight: 900;
}

.my-files-quick-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.7;
}

.my-files-search-card {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(18,214,160,.34);
    box-shadow: 0 12px 28px rgba(7,25,35,.07);
    display: grid;
    gap: 12px;
}

.my-files-search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.my-files-search-form input {
    height: 48px;
    border-radius: 14px;
    padding: 0 16px;
}

.my-files-counter {
    color: var(--muted);
    font-weight: 800;
}

.my-files-counter strong {
    color: var(--sara-teal-dark);
    font-size: 18px;
}

.my-files-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.my-file-card {
    background: #ffffff;
    border: 1px solid rgba(18,214,160,.34);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 30px rgba(7,25,35,.08);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.my-file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(7,25,35,.12);
    border-color: var(--sara-teal);
}

.my-file-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.my-file-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eafff8;
    border: 1px solid rgba(18,214,160,.38);
    font-size: 24px;
}

.my-file-top h3 {
    margin: 0 0 6px;
    color: var(--sara-navy);
    font-size: 18px;
    font-weight: 900;
}

.my-file-top p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
    word-break: break-word;
    line-height: 1.6;
}

.my-file-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.my-file-meta div {
    background: #f8fffd;
    border: 1px solid rgba(18,214,160,.22);
    border-radius: 14px;
    padding: 10px;
}

.my-file-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}

.my-file-meta strong {
    display: block;
    color: var(--sara-navy);
    font-size: 13px;
    word-break: break-word;
}

.my-file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.my-file-actions .btn {
    flex: 1;
    text-align: center;
}

.my-files-empty {
    grid-column: 1 / -1;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(18,214,160,.34);
}

@media (max-width: 900px) {
    .my-files-grid {
        grid-template-columns: 1fr;
    }

    .my-files-quick-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .my-files-quick-card .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .my-files-search-form {
        grid-template-columns: 1fr;
    }

    .my-files-search-form button,
    .my-files-search-form .btn {
        width: 100%;
        text-align: center;
    }

    .my-file-meta {
        grid-template-columns: 1fr;
    }

    .my-file-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}


/* Hide old repeated user edit cards */
.user-edit-card {
    display: none !important;
}


/* Security dropdown navigation */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    color: #ffffff;
    text-decoration: none;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 900;
    user-select: none;
    transition: .2s ease;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::after {
    content: " ▾";
    font-size: 12px;
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover {
    background: rgba(18,214,160,.22);
}

.nav-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 230px;
    display: none;
    background: #ffffff;
    border: 1px solid rgba(18,214,160,.34);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 18px 38px rgba(7,25,35,.18);
    z-index: 3000;
}

.nav-dropdown[open] .nav-dropdown-content {
    display: grid;
    gap: 6px;
}

.nav-dropdown-content a {
    display: block;
    color: var(--sara-navy) !important;
    background: #f8fffd !important;
    border: 1px solid rgba(18,214,160,.22) !important;
    border-radius: 12px !important;
    padding: 11px 12px !important;
    text-align: start !important;
    white-space: nowrap;
    font-weight: 900;
}

.nav-dropdown-content a:hover {
    background: #eafff8 !important;
    color: var(--sara-teal-dark) !important;
}

@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown summary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .nav-dropdown-content {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-sizing: border-box;
    }

    .nav-dropdown-content a {
        text-align: center !important;
        white-space: normal;
    }
}


/* Clean ordered main navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav a,
.main-nav .language-select {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 900;
}

.main-nav a {
    padding: 0 18px;
}

.language-form {
    margin: 0;
}

.language-select {
    padding: 0 18px;
}

@media (max-width: 900px) {
    .topbar {
        align-items: center;
    }

    .main-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .main-nav a,
    .main-nav .language-select {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .language-form {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .main-nav {
        grid-template-columns: 1fr;
    }
}





/* REMOVE HI SAFETY BEGIN */
.nav-greeting {
    display: none !important;
}
/* REMOVE HI SAFETY END */


/* SAFE BACK BUTTON STYLE BEGIN */

.safe-back-section {
    width: 100%;
    max-width: 1720px;
    margin: 12px auto 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
}

.safe-back-btn {
    min-height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #102536, #0aa77d);
    color: #ffffff;
    font-family: "Cairo", Arial, sans-serif;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(16, 37, 54, 0.14);
    transition: 0.2s ease;
}

.safe-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(16, 37, 54, 0.20);
}

@media (max-width: 760px) {
    .safe-back-section {
        padding: 0 14px;
    }

    .safe-back-btn {
        width: 100%;
    }
}

/* SAFE BACK BUTTON STYLE END */

