/* ===== DESIGN SYSTEM v16 — Blue Depth (dark) / Roonie (light) ======
   Dark  → coherent navy-blue palette: #0A1628 (deep navy) surfaces,
           #2F80ED (clear blue) accent, near-white text — standard
           WCAG 2.1 AA contrast (body text ≥ 4.5:1, large text ≥ 3:1).
   Light → #85644D (walnut) + #515645 (olive) + #9CA273 (sage)
   No orange anywhere.
==================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Vazirmatn:wght@400;500;600;700&display=swap');

:root {
    /* ---- Dark source palette: Blue Depth ---- */
    --p-navy-deep: #0A1628;
    --p-navy-card: #122540;
    --p-blue:      #2F80ED;

    /* Semantic — Dark (default) */
    --primary-color: #478EEB;
    --primary-mid: #5FA0EF;
    --primary-light: #7EB2F5;
    --primary-pale: #1D4ED8;
    --primary-faint: #163A66;
    --primary-dark: #1E56A0;
    --secondary-color: #163A66;
    --accent-color: #7EB2F5;
    --accent-mid: #5B9BEA;
    --accent-light: #BBD6FA;
    --accent-dark: #2F6FCE;
    --success-color: #22C55E;
    --warning-color: #F5A524;
    --danger-color: #F55D5D;
    --info-color: #4F94F0;
    --purple-color: #9F7AEA;
    --brand-blue: #478EEB;
    --brand-green: #22C55E;
    --brand-red: #EF4444;
    --link-color: #6FA8F5;
    --icon-blue: #6FA8F5;
    --icon-green: #34D399;
    --icon-red: #F87171;

    /* Surfaces — deep navy blue */
    --dark-bg: #0A1628;
    --card-bg: #122540;
    --card-border: rgba(148, 178, 220, 0.16);
    --text-primary: #F1F5FB;
    --text-secondary: #A8BEDC;
    --text-light: #C7D6EC;
    --text-on-tint: #F1F5FB;
    --text-muted-on-tint: #A8BEDC;
    --text-on-pastel: #0A1628;
    --text-muted-on-pastel: #16324F;
    --sidebar-bg: #0E1D33;
    --input-bg: rgba(234, 240, 250, 0.06);
    --overlay-1: rgba(234, 240, 250, 0.05);
    --overlay-2: rgba(234, 240, 250, 0.09);
    --overlay-3: rgba(234, 240, 250, 0.13);
    --overlay-faint: rgba(234, 240, 250, 0.03);
    --overlay-locked: rgba(234, 240, 250, 0.02);
    --gradient-primary: linear-gradient(135deg, #2563EB, #163A66);
    --gradient-gold: linear-gradient(135deg, #7EB2F5, #4F94F0);
    --gradient-success: linear-gradient(135deg, #34D399, #16A34A);
    --shadow-lg: 0 12px 32px rgba(2, 6, 14, 0.55);
    --shadow-md: 0 6px 16px rgba(2, 6, 14, 0.40);
    --shadow-1: 0 2px 8px rgba(2, 6, 14, 0.30);
    --shadow-2: 0 8px 24px rgba(2, 6, 14, 0.50);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --font-family: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --glass-bg: rgba(18, 37, 64, 0.88);
    --glass-border: rgba(148, 178, 220, 0.22);
    --glass-shadow: 0 8px 32px rgba(2, 6, 14, 0.45), 0 1px 0 rgba(241, 245, 251, 0.06) inset;

    --tint-blue-bg: #16345A;
    --tint-blue-border: #2F6FCE;
    --tint-blue-hover: #1D4272;
    --tint-green-bg: #123524;
    --tint-green-border: #22C55E;
    --tint-green-hover: #16452F;
    --tint-amber-bg: #3A2C10;
    --tint-amber-border: #F5A524;
    --tint-amber-hover: #4A3814;
    --tint-red-bg: #3A1616;
    --tint-red-border: #EF4444;
    --tint-red-hover: #4A1C1C;
    --tint-purple-bg: #241C3A;
    --tint-purple-border: #9F7AEA;
    --tint-purple-hover: #2E2448;
    --tint-text: #F1F5FB;
    --tint-text-muted: #A8BEDC;
    --accent-color-rgb: 126, 178, 245;
}

html[data-theme="light"] {
    /* ---- Light source palette (Roonie) ---- */
    --p-walnut: #85644D;
    --p-olive:  #515645;
    --p-sage:   #9CA273;

    --primary-color: #515645;
    --primary-mid: #6A7058;
    --primary-light: #9CA273;
    --primary-pale: #D4D8C4;
    --primary-faint: #E8EBE0;
    --primary-dark: #3A3E30;
    --secondary-color: #515645;
    --accent-color: #85644D;
    --accent-mid: #9A7A60;
    --accent-light: #B89878;
    --accent-dark: #6B4E3A;
    --success-color: #515645;
    --warning-color: #A07D45;
    --danger-color: #A04A4A;
    --info-color: #85644D;
    --purple-color: #6A6470;
    --brand-blue: #85644D;
    --brand-green: #515645;
    --brand-red: #A04A4A;
    --link-color: #515645;
    --icon-blue: #85644D;
    --icon-green: #515645;
    --icon-red: #A04A4A;

    /* Surfaces — warm paper + sage */
    --dark-bg: #F4F2EC;
    --card-bg: #FFFFFF;
    --card-border: #D4D0C4;
    --text-primary: #2C2A26;
    --text-secondary: #515645;
    --text-light: #3A3E30;
    --text-on-tint: #2C2A26;
    --text-muted-on-tint: #515645;
    --text-on-pastel: #2C2A26;
    --text-muted-on-pastel: #515645;
    --sidebar-bg: #FFFFFF;
    --input-bg: rgba(44, 42, 38, 0.04);
    --overlay-1: rgba(44, 42, 38, 0.04);
    --overlay-2: rgba(44, 42, 38, 0.06);
    --overlay-3: rgba(44, 42, 38, 0.09);
    --overlay-faint: rgba(44, 42, 38, 0.03);
    --overlay-locked: rgba(44, 42, 38, 0.02);
    --gradient-primary: linear-gradient(135deg, #515645, #3A3E30);
    --gradient-gold: linear-gradient(135deg, #85644D, #6B4E3A);
    --gradient-success: linear-gradient(135deg, #6A7058, #515645);
    --shadow-lg: 0 12px 28px rgba(44, 42, 38, 0.10);
    --shadow-md: 0 6px 16px rgba(44, 42, 38, 0.08);
    --shadow-1: 0 2px 8px rgba(44, 42, 38, 0.06);
    --shadow-2: 0 8px 24px rgba(44, 42, 38, 0.10);
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(81, 86, 69, 0.14);
    --glass-shadow: 0 8px 28px rgba(44, 42, 38, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;

    --tint-blue-bg: #EDE8E0;
    --tint-blue-border: #C8B8A8;
    --tint-blue-hover: #E0D8CE;
    --tint-green-bg: #E8EBE0;
    --tint-green-border: #9CA273;
    --tint-green-hover: #D8DCC8;
    --tint-amber-bg: #F2EBE0;
    --tint-amber-border: #C4A878;
    --tint-amber-hover: #E8DCC8;
    --tint-red-bg: #F5E8E8;
    --tint-red-border: #D0A0A0;
    --tint-red-hover: #ECD8D8;
    --tint-purple-bg: #EBE8EC;
    --tint-purple-border: #C0B8C4;
    --tint-purple-hover: #E0DCE4;
    --tint-text: #2C2A26;
    --tint-text-muted: #515645;
    --accent-color-rgb: 133, 100, 77;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-family);
    font-size: 15px;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(79, 148, 240, 0.14), transparent 50%),
        radial-gradient(ellipse at 88% 100%, rgba(29, 78, 216, 0.30), transparent 45%),
        var(--dark-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.55;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    transition: background .3s ease, color .3s ease;
    -webkit-tap-highlight-color: transparent;
}
html[data-theme="light"] body {
    background:
        radial-gradient(ellipse at 12% 0%, rgba(156, 162, 115, 0.18), transparent 50%),
        radial-gradient(ellipse at 88% 100%, rgba(133, 100, 77, 0.12), transparent 45%),
        var(--dark-bg);
}
h1, h2, h3, h4, .page-header h1, .section-title, .logo-text h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
button, a, select, input, .option-label, .conclusion-card, .nav-item { touch-action: manipulation; }

html[data-theme="dark"] select option { background-color: #122540; color: #F1F5FB; }
html[data-theme="dark"] .multi-select-dropdown .option { color: #F1F5FB; background: #122540; }
html[data-theme="dark"] .multi-select-dropdown .option:hover { background: #1D4272; }
html[data-theme="dark"] .multi-select-dropdown .option.selected { background: #1D4ED8; }

.app-container { display: flex; min-height: 100vh; max-width: 1800px; margin: 0 auto; position: relative; }
.sidebar {
    width: 320px; background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-right: 1px solid var(--glass-border); padding: 24px 0; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; transition: background .3s; z-index: 50;
}
.sidebar-header { padding: 0 24px 24px; border-bottom: 1px solid var(--card-border); margin-bottom: 24px; }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; justify-content: space-between; }
.logo-mark { display: none; }
.logo-text { flex: 1; min-width: 0; }
.logo-text h1 {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: .3px;
    background: linear-gradient(to right, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text p { font-size: .78rem; color: var(--text-secondary); letter-spacing: .4px; text-transform: uppercase; }
.confidential-badge {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px;
    font-size: .68rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-color);
    border: 1px solid rgba(var(--accent-color-rgb), 0.4); border-radius: 20px; background: rgba(var(--accent-color-rgb), 0.08);
}
.confidential-badge i { font-size: .65rem; }
.theme-toggle {
    background: var(--overlay-1); border: 1px solid var(--card-border); color: var(--text-primary);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 1rem; transition: all .3s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary-color); color: #fff; transform: rotate(180deg); }
.header-info { font-size: .8rem; color: var(--text-secondary); }
.header-info .warning-banner {
    margin-top: 10px; font-size: .72rem; color: var(--warning-color); background: rgba(212, 180, 131, 0.14);
    border: 1px solid rgba(192, 122, 30, 0.3); border-radius: 8px; padding: 8px 10px; line-height: 1.5;
}
.sidebar-nav { flex: 1; padding: 0 16px; display: flex; flex-direction: column; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 8px; border-radius: var(--radius-md);
    color: var(--text-secondary); text-decoration: none; transition: all .25s; cursor: pointer; border: none;
    background: transparent; width: 100%; text-align: left; font-size: .9rem; font-family: var(--font-family);
}
.nav-item:hover { background: rgba(30, 58, 95, 0.08); color: var(--text-primary); }
.nav-item.active {
    background: rgba(var(--accent-color-rgb), 0.12); color: var(--accent-color); border-left: 3px solid var(--accent-color); font-weight: 600;
}
.sidebar-footer { padding: 20px 16px; text-align: center; border-top: 1px solid var(--card-border); margin-top: auto; }
.sidebar-footer img { max-width: 120px; height: auto; display: block; margin: 0 auto; }
.sidebar-footer .copy { font-size: .68rem; font-weight: 600; letter-spacing: 1.2px; color: var(--accent-color); margin-top: 10px; }

.progress-section { padding: 24px; border-top: 1px solid var(--card-border); }
.progress-ring-wrap { margin-bottom: 16px; }
.dept-progress-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.dept-progress-item { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-secondary); }
.dept-progress-item .dept-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-progress-item .mini-bar { width: 60px; height: 4px; background: var(--overlay-2); border-radius: 2px; overflow: hidden; }
.dept-progress-item .mini-fill { height: 100%; background: var(--gradient-success); transition: width .5s; }
.dept-progress-item .pct { min-width: 35px; text-align: left; font-weight: 600; color: var(--primary-color); }

.main-content { flex: 1; padding: 24px; overflow-y: auto; max-height: 100vh; min-width: 0; }
.top-bar { display: flex; flex-direction: column; align-items: stretch; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--card-border); gap: 16px; }
.top-bar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.save-status {
    display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--text-secondary);
    padding: 6px 12px; border-radius: 20px; background: var(--overlay-1); border: 1px solid var(--card-border);
    white-space: nowrap; transition: all .25s;
}
.save-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-secondary); flex-shrink: 0; transition: all .25s; }
.save-status.saving .dot { background: var(--warning-color); animation: pulseDot 1s ease-in-out infinite; }
.save-status.saved .dot { background: var(--success-color); }
.save-status.saved { color: var(--success-color); border-color: rgba(31, 138, 112, 0.35); background: rgba(31, 138, 112, 0.08); }
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(1.3); } }

.step-nav { display: flex; align-items: flex-start; gap: 0; padding: 4px 4px 8px; }
.step-nav-item { display: flex; align-items: center; flex: 1; min-width: 0; }
.step-nav-item:last-child .step-line { display: none; }
.step-btn {
    display: flex; align-items: center; gap: 10px; background: transparent; border: none; cursor: pointer;
    padding: 6px 4px; font-family: var(--font-family); color: var(--text-secondary); text-align: left;
    border-radius: var(--radius-sm); transition: all .2s; min-width: 0;
}
.step-btn:hover { color: var(--text-primary); }
.step-circle {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card-border); display: flex;
    align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; flex-shrink: 0;
    background: var(--input-bg); color: var(--text-secondary); transition: all .25s;
}
.step-label { display: flex; flex-direction: column; min-width: 0; }
.step-label .step-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-label .step-hint { font-size: .68rem; color: var(--text-secondary); white-space: nowrap; }
.step-line { flex: 1; height: 2px; background: var(--card-border); margin: 0 6px; min-width: 16px; transition: background .3s; }
.step-nav-item.completed .step-circle { background: var(--gradient-success); border-color: var(--success-color); color: #fff; }
.step-nav-item.completed .step-line { background: var(--success-color); }
.step-nav-item.current .step-circle { border-color: var(--accent-color); color: var(--accent-color); background: rgba(var(--accent-color-rgb), 0.12); box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.15); }
.step-nav-item.current .step-name { color: var(--accent-color); }
@media (max-width: 1200px) { .step-nav { display: none; } }
@media (max-width: 900px) { .step-label { display: none; } }
.quick-actions-box {
    background: var(--input-bg); border-radius: var(--radius-md); padding: 12px 18px; border: 1px solid var(--card-border);
    display: inline-flex; gap: 12px; flex-wrap: wrap; align-items: center; backdrop-filter: blur(4px);
}
.btn-file {
    background: var(--gradient-primary); color: white; border: none; padding: 10px 18px; border-radius: var(--radius-md);
    cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 500; transition: all .25s; font-size: .88rem; font-family: var(--font-family);
}
.btn-file.btn-import { background: linear-gradient(135deg, #1f8a70, #146354); }
.btn-file.btn-export { background: linear-gradient(135deg, #c07a1e, #9c5f13); }
.btn-file.btn-full-export { background: var(--gradient-primary); }
.btn-file.btn-reset { background: transparent; color: var(--danger-color); border: 1px solid rgba(179, 39, 58, 0.4); box-shadow: none; }
.btn-file.btn-reset:hover { background: rgba(179, 39, 58, 0.1); border-color: var(--danger-color); }
.btn-file:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.05); }

.mobile-nav-select { display: none; margin-bottom: 16px; width: 100%; }
.mobile-nav-select select {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--card-border);
    background: var(--input-bg); color: var(--text-primary); font-size: 1rem; font-family: var(--font-family);
    appearance: auto; cursor: pointer;
}
.mobile-nav-select select:focus { outline: 2px solid var(--primary-color); border-color: var(--primary-color); }

.tab-content { display: none; animation: fadeIn .3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section {
    background: var(--glass-bg); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-radius: var(--radius-lg); padding: 30px 28px 28px; margin-bottom: 24px; box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    transition: all .3s; position: relative;
    overflow: hidden;
}
.section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: none;
}
.section:hover { box-shadow: var(--glass-shadow), 0 0 0 1px rgba(30, 58, 95, 0.08); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--card-border); flex-wrap: wrap; gap: 12px; }
.section-title-area { display: flex; align-items: center; gap: 12px; }
.section-icon { width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; border: 1px solid currentColor; opacity: .95; }
.section-1 .section-icon { background: rgba(30, 58, 95, 0.2); color: var(--primary-color); }
.section-2 .section-icon { background: rgba(var(--accent-color-rgb), 0.2); color: var(--accent-color); }
.section-3 .section-icon { background: rgba(31, 138, 112, 0.2); color: var(--success-color); }
.section-4 .section-icon { background: rgba(212, 180, 131, 0.2); color: var(--warning-color); }
.section-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: .2px; }
.subsection-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--text-primary);
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.subsection-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
}
.approval-section .subsection-title { margin-top: 0; }

.section-subtitle { font-size: .85rem; color: var(--text-secondary); letter-spacing: .2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; position: relative; }
.form-label { font-size: .9rem; font-weight: 500; color: var(--text-light); display: flex; align-items: center; gap: 6px; transition: color .2s, transform .2s; transform-origin: right center; }
.form-input, .form-select, .form-textarea {
    padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--card-border); background: var(--input-bg);
    color: var(--text-primary); font-size: .95rem; transition: all .25s; width: 100%; font-family: var(--font-family); position: relative;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: 2px solid var(--primary-color); outline-offset: 2px; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15), 0 2px 8px rgba(30, 58, 95, 0.1);
}
.form-textarea { min-height: 150px; resize: vertical; }
.form-input.invalid, .form-textarea.invalid { border-color: var(--danger-color); }
.validation-error { color: var(--danger-color); font-size: .8rem; margin-top: 4px; display: none; align-items: center; gap: 4px; }
.validation-error.show { display: flex; animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.option-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; padding: 5px; background: var(--overlay-faint); border-radius: calc(var(--radius-md) + 5px); border: 1px solid var(--card-border); }
.option-item { position: relative; flex: 1; min-width: 150px; }
.option-input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-label { display: flex; align-items: center; gap: 9px; padding: 12px 20px; background: transparent; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; transition: all .25s cubic-bezier(.4, 0, .2, 1); width: 100%; position: relative; }
.option-label i { transition: transform .25s; color: var(--text-secondary); }
.option-input:checked+.option-label { background: rgba(30, 58, 95, 0.14); border-color: var(--primary-color); color: var(--primary-color); box-shadow: 0 2px 10px rgba(30, 58, 95, 0.18); }
.option-input:checked+.option-label i { color: var(--primary-color); transform: scale(1.1); }
.option-input:focus-visible+.option-label { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.option-label:hover { background: var(--overlay-2); }
.option-input:checked+.option-label::after { content: "✓"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: bold; color: #fff; background: var(--success-color); width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.locked-field { background: var(--overlay-locked) !important; color: var(--text-secondary) !important; cursor: not-allowed !important; border-color: var(--card-border) !important; }
.locked-field:focus { outline: none !important; box-shadow: none !important; }

.lock-controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.lock-controls .btn { width: 100%; text-align: center; justify-content: center; }
.btn { padding: 10px 20px; border: none; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: all .25s; font-family: var(--font-family); font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--gradient-primary); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff; }
.btn-secondary { background: var(--overlay-1); color: var(--text-primary); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--overlay-3); color: var(--text-primary); }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-danger:hover { background: #b71f2b; transform: translateY(-2px); color: #fff; }
/* Ensure icon buttons on colored surfaces keep contrast */
.btn { -webkit-font-smoothing: antialiased; }

.multi-select-container { position: relative; margin-top: 8px; }
.multi-select-trigger { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text-primary); cursor: pointer; transition: all .25s; min-height: 54px; }
.multi-select-trigger:hover { border-color: var(--primary-color); }
.multi-select-trigger .placeholder { color: var(--text-secondary); }
.multi-select-trigger .arrow { transition: transform .3s; color: var(--text-secondary); }
.multi-select-trigger.open .arrow { transform: rotate(180deg); }
.multi-select-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 200px; overflow-y: auto; z-index: 100; display: none; padding: 8px 0; }
.multi-select-dropdown.open { display: block; }
.multi-select-dropdown .option { padding: 10px 16px; cursor: pointer; transition: background .2s; display: flex; align-items: center; gap: 10px; }
.multi-select-dropdown .option:hover { background: rgba(30, 58, 95, 0.08); }
.multi-select-dropdown .option .check { width: 20px; height: 20px; border: 2px solid var(--card-border); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s; color: transparent; }
.multi-select-dropdown .option.selected .check { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.multi-select-dropdown .option .label { flex: 1; }
.selected-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 8px 0; }
.selected-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 14px; background: rgba(30, 58, 95, 0.15); border: 1px solid rgba(30, 58, 95, 0.3); border-radius: 20px; font-size: .85rem; color: var(--text-primary); transition: all .2s; }
.selected-tag .remove-tag { width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(179, 39, 58, 0.15); color: var(--danger-color); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .75rem; transition: all .2s; flex-shrink: 0; }
.selected-tag .remove-tag:hover { background: var(--danger-color); color: #fff; }

.signature-selector-container { margin-top: 8px; }
.signature-selector-container .selected-signatures { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.signature-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; background: var(--input-bg); border-radius: var(--radius-md); border: 1px solid var(--card-border); transition: all .2s; position: relative; }
.signature-item .sig-role { font-weight: 600; color: var(--text-light); min-width: 150px; font-size: .9rem; }
.signature-item .sig-input { flex: 1; min-width: 160px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: .9rem; transition: all .25s; font-family: var(--font-family); }
.signature-item .sig-input:focus { outline: 2px solid var(--primary-color); border-color: var(--primary-color); }
.signature-item .remove-sig { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(179, 39, 58, 0.1); color: var(--danger-color); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: all .2s; flex-shrink: 0; }
.signature-item .remove-sig:hover { background: var(--danger-color); color: #fff; }
.signature-selector-container .add-sig-btn { width: 100%; padding: 12px; background: rgba(30, 58, 95, 0.08); border: 1px dashed var(--primary-color); border-radius: var(--radius-md); color: var(--primary-color); cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .3s; font-family: var(--font-family); margin-top: 8px; }
.signature-selector-container .add-sig-btn:hover { background: rgba(30, 58, 95, 0.15); }

.conclusion-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.conclusion-card {
    padding: 24px; border-radius: var(--radius-lg); border: 2px solid transparent; cursor: pointer;
    transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
    display: flex; flex-direction: column; gap: 12px; position: relative;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.conclusion-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-lg); }
.conclusion-card.selected { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2); }
.conclusion-card.selected::after { content: '✓'; position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; background: var(--primary-color); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; }
.conclusion-possible.selected { border-color: var(--success-color); box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.25); }
.conclusion-possible.selected::after { background: var(--success-color); }
.conclusion-conditional.selected { border-color: var(--warning-color); box-shadow: 0 0 0 3px rgba(212, 180, 131, 0.25); }
.conclusion-conditional.selected::after { background: var(--warning-color); }
.conclusion-not-possible.selected { border-color: var(--danger-color); box-shadow: 0 0 0 3px rgba(179, 39, 58, 0.25); }
.conclusion-not-possible.selected::after { background: var(--danger-color); }

/* Soft pastel default — high-contrast dark text (WCAG AA on all pastels) */
.conclusion-possible { background: #e6f4ee; border-color: #a8d5c0; color: var(--text-on-pastel, #111111); }
.conclusion-conditional { background: #fef6e8; border-color: #f5d9a8; color: var(--text-on-pastel, #111111); }
.conclusion-not-possible { background: #fde8ea; border-color: #f0b0b5; color: var(--text-on-pastel, #111111); }

/* One shade darker on hover — text stays dark for readability */
.conclusion-possible:hover,
.conclusion-possible.selected {
    background: #c5e6d6; border-color: #40916c; color: var(--text-on-pastel, #111111);
}
.conclusion-conditional:hover,
.conclusion-conditional.selected {
    background: #f8e4bc; border-color: #c47d0e; color: var(--text-on-pastel, #111111);
}
.conclusion-not-possible:hover,
.conclusion-not-possible.selected {
    background: #f7c8cd; border-color: #df2935; color: var(--text-on-pastel, #111111);
}
.conclusion-possible:hover .conclusion-desc,
.conclusion-possible.selected .conclusion-desc,
.conclusion-conditional:hover .conclusion-desc,
.conclusion-conditional.selected .conclusion-desc,
.conclusion-not-possible:hover .conclusion-desc,
.conclusion-not-possible.selected .conclusion-desc {
    color: var(--text-muted-on-pastel, #333333);
}
.conclusion-possible:hover .conclusion-icon,
.conclusion-possible.selected .conclusion-icon {
    background: #40916c; color: #fff;
}
.conclusion-conditional:hover .conclusion-icon,
.conclusion-conditional.selected .conclusion-icon {
    background: #c47d0e; color: #fff;
}
.conclusion-not-possible:hover .conclusion-icon,
.conclusion-not-possible.selected .conclusion-icon {
    background: #df2935; color: #fff;
}

.conclusion-header { display: flex; align-items: center; gap: 12px; }
.conclusion-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; color: #fff; transition: background .35s, color .35s; }
.conclusion-possible .conclusion-icon { background: #40916c; }
.conclusion-conditional .conclusion-icon { background: #c47d0e; }
.conclusion-not-possible .conclusion-icon { background: #df2935; }
.conclusion-title { font-size: 1.1rem; font-weight: 600; color: var(--text-on-pastel, #111111); transition: color .35s; }
.conclusion-desc { font-size: .9rem; color: var(--text-muted-on-pastel, #333333); line-height: 1.5; transition: color .35s; }

.dept-select-wrapper { margin-bottom: 24px; padding: 16px 20px; background: var(--input-bg); border-radius: var(--radius-md); border: 1px solid var(--card-border); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dept-select-wrapper label { font-weight: 600; color: var(--text-light); white-space: nowrap; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.dept-select-wrapper select { flex: 1; min-width: 240px; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: .95rem; font-family: var(--font-family); cursor: pointer; transition: all .25s; appearance: auto; }
.dept-select-wrapper select:focus { outline: 2px solid var(--primary-color); border-color: var(--primary-color); }
.dept-select-wrapper select option { background: var(--card-bg); color: var(--text-primary); padding: 8px; }

.department-content { display: none; animation: fadeIn .3s; }
.department-content.active { display: block; }

.table-scroll-hint { display: none; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-secondary); margin-top: 14px; margin-bottom: -6px; }
.table-scroll-hint i { color: var(--primary-color); }
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--card-border); margin-top: 16px; position: relative; }
.sixm-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 700px; table-layout: fixed; }
.sixm-table th { background: var(--card-bg); padding: 16px 12px; font-weight: 600; text-align: left; border-bottom: 2px solid var(--card-border); position: sticky; top: 0; z-index: 10; white-space: nowrap; }
.sixm-table th:first-child { width: 26%; }
.sixm-table th:nth-child(2),
.sixm-table th:nth-child(3) { width: 37%; }
.sixm-table td { padding: 14px 12px; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.sixm-table tr:last-child td { border-bottom: none; }
.sixm-table tr:hover td { background: rgba(30, 58, 95, 0.03); }
.category-row { background: rgba(30, 58, 95, 0.15) !important; border-right: 4px solid var(--primary-color); }
.category-row td { font-weight: 700; color: var(--primary-color); padding: 14px 10px; font-size: .95rem; }
.table-textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: .9rem; transition: all .25s; min-height: 120px; resize: vertical; min-width: 0; font-family: var(--font-family); box-sizing: border-box; }
.table-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15); }

/* Desktop only: larger M boxes + smaller Points to consider */
@media (min-width: 769px) {
    .sixm-hint-cell {
        font-size: .8rem;
        line-height: 1.4;
        color: var(--text-secondary);
    }
    .sixm-hint-title {
        display: block;
        font-weight: 600;
        color: var(--text-primary);
        font-size: .82rem;
        margin-bottom: 4px;
    }
    .sixm-hint-detail {
        display: block;
        font-size: .75rem;
        color: var(--text-secondary);
        font-weight: 400;
        line-height: 1.35;
    }
    .sixm-table .table-textarea {
        min-height: 140px;
        padding: 14px 16px;
    }
}
.dept-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dept-json-btn { background: linear-gradient(135deg, #1f8a70, #146354); color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 14px; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .25s; font-family: var(--font-family); }
.dept-json-btn.upload { background: var(--gradient-gold); color: #2a1f0d; }
.dept-json-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.dept-note-container { margin-top: 24px; padding: 16px; background: var(--input-bg); border-radius: var(--radius-md); border: 1px solid var(--card-border); }
.dept-note-label { font-size: .9rem; font-weight: 600; margin-bottom: 10px; color: var(--accent-color); display: flex; align-items: center; gap: 8px; }
.dept-note-textarea { width: 100%; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: .85rem; resize: vertical; min-height: 80px; font-family: var(--font-family); }
.dept-note-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-delete-note { background: rgba(179, 39, 58, 0.2); border: none; color: var(--danger-color); padding: 6px 12px; border-radius: var(--radius-sm); font-size: .8rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .25s; font-family: var(--font-family); }
.btn-delete-note:hover { background: rgba(179, 39, 58, 0.4); transform: translateY(-2px); }

.file-upload-container { border: 2px dashed var(--card-border); border-radius: var(--radius-md); padding: 20px; margin-top: 10px; transition: all .3s; }
.file-upload-container.drag-over { border-color: var(--primary-color); background: rgba(30, 58, 95, 0.05); }
.file-upload-area { text-align: center; padding: 30px 20px; background: var(--input-bg); border-radius: var(--radius-sm); cursor: pointer; transition: all .3s; }
.file-upload-area:hover { background: rgba(30, 58, 95, 0.05); border-color: var(--primary-color); }
.uploaded-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 15px; }
.uploaded-file-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--card-border); padding: 12px; background: var(--input-bg); }
.file-info { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.file-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.file-icon.image { background: rgba(30, 58, 95, 0.2); color: var(--primary-color); }
.file-icon.pdf { background: rgba(179, 39, 58, 0.2); color: var(--danger-color); }
.file-icon.word { background: rgba(30, 58, 95, 0.2); color: var(--primary-color); }
.file-icon.excel { background: rgba(31, 138, 112, 0.2); color: var(--success-color); }
.file-icon.other { background: rgba(212, 180, 131, 0.2); color: var(--warning-color); }
.file-details { flex: 1; min-width: 0; }
.file-name { font-size: .85rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: .75rem; color: var(--text-secondary); }
.file-desc-input { width: 100%; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: .8rem; margin-top: 5px; font-family: var(--font-family); }
.delete-file-btn, .download-file-btn { position: absolute; top: 8px; width: 26px; height: 26px; border-radius: 50%; border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: .8rem; transition: all .2s; }
.delete-file-btn { left: 8px; background: var(--danger-color); }
.download-file-btn { left: 38px; background: var(--success-color); }
.delete-file-btn:hover, .download-file-btn:hover { transform: scale(1.1); }

.approval-section { background: var(--input-bg); border-radius: var(--radius-md); padding: 20px; margin-top: 24px; border: 1px solid var(--card-border); }
.approval-section h4 { margin-bottom: 16px; color: var(--accent-color); font-size: 1.1rem; }

.network-links-section { background: var(--input-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 20px; margin-top: 24px; transition: all .3s; }
.network-links-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(--card-border); }
.network-links-title { font-size: 1rem; font-weight: 600; color: var(--accent-color); display: flex; align-items: center; gap: 8px; }
.network-links-list { display: flex; flex-direction: column; gap: 10px; }
.network-link-item { display: flex; align-items: center; justify-content: space-between; background: var(--input-bg); padding: 10px 15px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); transition: all .3s; }
.network-link-item:hover { background: rgba(30, 58, 95, 0.1); border-color: var(--primary-color); }
.link-info { display: flex; align-items: center; gap: 10px; overflow: hidden; flex: 1; }
.link-icon { width: 32px; height: 32px; background: rgba(30, 58, 95, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary-color); flex-shrink: 0; }
.link-text { display: flex; flex-direction: column; white-space: nowrap; min-width: 0; flex: 1; }
.link-name { font-size: .9rem; color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.link-url { font-size: .75rem; color: var(--text-secondary); direction: ltr; text-align: left; margin-top: 2px; font-family: monospace; overflow: hidden; text-overflow: ellipsis; }
.link-actions { display: flex; gap: 8px; align-items: center; }
.btn-link-open { background: var(--gradient-success); color: #fff; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: .8rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: all .2s; font-family: var(--font-family); }
.btn-link-open:hover { opacity: .9; transform: translateY(-1px); }
.btn-link-remove { background: transparent; color: var(--danger-color); border: 1px solid var(--danger-color); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .3s; }
.btn-link-remove:hover { background: var(--danger-color); color: #fff; }
.add-link-btn { width: 100%; padding: 10px; background: rgba(30, 58, 95, 0.1); border: 1px dashed var(--primary-color); color: var(--primary-color); border-radius: var(--radius-sm); cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; transition: all .3s; font-family: var(--font-family); }
.add-link-btn:hover { background: rgba(30, 58, 95, 0.2); }
.add-link-btn:disabled { opacity: .6; cursor: not-allowed; }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: 400px; }
.toast { background: var(--card-bg); border-radius: var(--radius-md); padding: 14px 18px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary-color); display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 400px; animation: toastIn .4s cubic-bezier(.21, 1.02, .73, 1); pointer-events: auto; border: 1px solid var(--card-border); }
.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }
.toast.info { border-left-color: var(--accent-color); }
.toast-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; color: #fff; }
.toast.success .toast-icon { background: var(--gradient-success); }
.toast.error .toast-icon { background: linear-gradient(135deg, var(--danger-color), #8f1d2c); }
.toast.warning .toast-icon { background: linear-gradient(135deg, var(--warning-color), #9c5f13); }
.toast.info .toast-icon { background: linear-gradient(135deg, var(--accent-color), var(--primary-color)); }
.toast-content { flex: 1; font-size: .9rem; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { color: var(--text-secondary); font-size: .85rem; }
.toast-close { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; border-radius: 50%; transition: all .2s; }
.toast-close:hover { background: var(--overlay-2); color: var(--text-primary); }
.toast.removing { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all .3s ease; backdrop-filter: blur(4px); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--glass-bg); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border-radius: var(--radius-lg); padding: 32px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; transform: translateY(20px) scale(.95); transition: transform .3s ease; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--card-border); }
.modal-close { background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all .2s; }
.modal-close:hover { background: var(--overlay-2); color: var(--danger-color); }

.confirm-dialog { background: var(--card-bg); border-radius: var(--radius-lg); padding: 28px; max-width: 440px; width: 90%; border: 1px solid var(--card-border); text-align: center; }
.confirm-dialog .confirm-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: rgba(192, 122, 30, 0.15); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--warning-color); }
.confirm-dialog.danger .confirm-icon { background: rgba(179, 39, 58, 0.15); color: var(--danger-color); }
.confirm-dialog h3 { margin-bottom: 10px; font-size: 1.2rem; }
.confirm-dialog p { color: var(--text-secondary); margin-bottom: 20px; font-size: .95rem; }
.confirm-dialog .confirm-actions { display: flex; gap: 12px; justify-content: center; }

.password-prompt { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); z-index: 2000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
.password-prompt.active { display: flex; }
.password-box { background: var(--glass-bg); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border-radius: var(--radius-lg); padding: 40px; max-width: 400px; width: 90%; border: 2px solid var(--primary-color); box-shadow: var(--glass-shadow), 0 0 40px rgba(30, 58, 95, 0.15); text-align: center; }
.password-box h3 { margin-bottom: 20px; color: var(--accent-color); font-size: 1.3rem; }
.password-input { width: 100%; padding: 15px; border-radius: var(--radius-md); border: 1px solid var(--primary-color); background: var(--input-bg); color: var(--text-primary); font-size: 1.3rem; text-align: center; letter-spacing: 8px; margin-bottom: 20px; font-family: var(--font-family); }
.password-input:focus { outline: 2px solid var(--accent-color); border-color: var(--accent-color); }
.password-error { color: var(--danger-color); margin-top: 10px; font-size: .9rem; display: none; }
.password-error.active { display: block; }

.file-status { font-size: .85rem; color: var(--text-primary); margin-bottom: 20px; padding: 14px 16px; background: var(--input-bg); border-radius: 10px; border-right: 3px solid var(--accent-color); display: flex; align-items: flex-start; gap: 10px; line-height: 1.7; }
.file-status i { color: var(--accent-color); margin-top: 4px; }
.guide-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: guide-step; }
.guide-steps li { display: flex; align-items: flex-start; gap: 10px; counter-increment: guide-step; }
.guide-steps li::before { content: counter(guide-step); flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-color); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }

#comments-list .comment-item { background: var(--input-bg); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; border: 1px solid var(--card-border); }
#comments-list .comment-header { display: flex; justify-content: space-between; margin-bottom: 8px; align-items: center; }
#comments-list .comment-header .meta { font-size: .85rem; color: var(--text-secondary); }
#comments-list .comment-header .del-btn { background: transparent; border: none; color: var(--danger-color); cursor: pointer; font-size: .9rem; }
#comments-list .comment-text { font-size: .95rem; }

.fab-container { position: fixed; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); left: calc(30px + env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px; z-index: 100; }
.fab { width: 60px; height: 60px; border-radius: 50%; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer; box-shadow: var(--shadow-lg); transition: all .3s; border: none; }
.fab:hover { transform: scale(1.1) rotate(90deg); }
.fab-menu { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; opacity: 0; transform: translateY(20px); transition: all .3s ease; pointer-events: none; }
.fab-menu.active { opacity: 1; transform: translateY(0); pointer-events: all; }
.fab-secondary { width: 50px; height: 50px; background: var(--gradient-success); font-size: 1.2rem; }
.fab-warning { width: 50px; height: 50px; background: linear-gradient(135deg, var(--warning-color), #9c5f13); font-size: 1.2rem; }
.fab-info { width: 50px; height: 50px; background: var(--gradient-gold); color: #2a1f0d; font-size: 1.2rem; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--overlay-faint); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

/* Login page */
#loginModal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 99999; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(10px); }
.login-box { background: var(--glass-bg); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); padding: 40px; border-radius: var(--radius-lg); width: 400px; max-width: 90%; text-align: center; box-shadow: var(--glass-shadow), 0 0 60px rgba(30, 58, 95, 0.12); border: 1px solid var(--glass-border); direction: ltr; }
.login-logo { max-width: 110px; height: auto; margin: 0 auto 16px; display: block; }
.login-subtitle { color: var(--text-secondary); font-size: .85rem; margin-bottom: 20px; margin-top: -8px; }
.login-field-label { display: block; text-align: left; font-size: .8rem; color: var(--text-light); margin: 12px 0 4px; font-weight: 500; }
.login-box h3 { margin-bottom: 20px; color: var(--accent-color); font-size: 1.5rem; }
.login-box input { width: 100%; padding: 14px 16px; margin: 8px 0; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text-primary); font-size: 1rem; box-sizing: border-box; font-family: var(--font-family); }
.login-box input:focus { outline: 2px solid var(--primary-color); border-color: var(--primary-color); }
.login-box button { width: 100%; padding: 14px; background: var(--gradient-primary); color: white; border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 1.1rem; font-weight: 600; margin-top: 15px; transition: all 0.3s; font-family: var(--font-family); }
.login-box button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.login-error { color: var(--danger-color); font-size: 0.9rem; margin-top: 10px; display: none; }
.login-error.show { display: block; animation: shake 0.4s; }

.mobile-nav-bar { display: none; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-md); align-items: center; justify-content: space-between; gap: 12px; }
.mobile-page-title { display: none; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.mobile-page-title i { color: var(--primary-color); font-size: 1.1rem; }

@media (max-width: 1200px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--card-border); position: relative; padding: 16px 0; }
    .sidebar-nav { display: none; }
    .mobile-nav-bar { display: flex; margin-bottom: 14px; }
    .mobile-page-title { display: flex; }
    .sidebar-header { padding: 0 16px 16px; margin-bottom: 12px; }
    .progress-section { display: none; }
    .main-content { max-height: none; padding: 16px; }
    .sidebar-footer { display: none; }
}
@media (max-width: 768px) {
    body { font-size: 0.9rem; }
    .main-content { padding: 12px; }
    .form-input, .form-select, .form-textarea, .dept-select-wrapper select, #dept-select, .login-box input, .password-input, .sig-input, .dept-note-textarea, .multi-select-trigger { font-size: 16px !important; }
    .section { padding: 16px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .section-title { font-size: 1rem; }
    .page-header h1 { font-size: 1.25rem; }
    .project-tabs a { font-size: 0.8rem; }
    .form-label { font-size: 0.8rem; }
    .btn { font-size: 0.85rem; }
    .data-table { font-size: 0.8rem; }
    .auth-box h3 { font-size: 1.15rem; }
    .form-grid { grid-template-columns: 1fr; }
    .option-group { flex-direction: column; flex-wrap: nowrap; gap: 10px; }
    .option-item { flex: none; width: 100%; min-width: 100%; }
    .option-label { padding: 13px 18px; }
    .btn-file { padding: 8px 12px; font-size: .8rem; width: 100%; justify-content: center; }
    .quick-actions-box { width: 100%; flex-direction: column; align-items: stretch; }
    .conclusion-cards { grid-template-columns: 1fr; }
    .dept-select-wrapper { flex-direction: column; align-items: stretch; }
    .dept-select-wrapper select { min-width: unset; }
    .sixm-table { font-size: .85rem; min-width: 0 !important; width: 100%; }
    .table-scroll-hint { display: none; }
    .sixm-table th, .sixm-table td { padding: 0; }
    .table-textarea {
        min-height: 48px !important;
        height: 48px;
        min-width: 0 !important;
        width: 100%;
        font-size: 16px !important;
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }
    .signature-item { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "role   remove" "input  input"; align-items: center; gap: 10px; }
    .signature-item .sig-role { grid-area: role; min-width: unset; }
    .signature-item .sig-input { grid-area: input; min-width: unset; width: 100%; }
    .signature-item .remove-sig { grid-area: remove; position: static; }
    .fab-container { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: calc(16px + env(safe-area-inset-left, 0px)); }
    .main-content { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
    .signature-item .remove-sig { width: 36px; height: 36px; }
    .fab { width: 50px; height: 50px; font-size: 1.2rem; }
    .fab-secondary, .fab-warning, .fab-info { width: 44px; height: 44px; font-size: 1rem; }
    .toast-container { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; left: 10px; max-width: none; }
    .toast { min-width: auto; max-width: none; }
    .multi-select-trigger { min-height: 44px; padding: 10px 14px; }
    .modal { padding: 20px; width: 95%; }
    .login-box { padding: 24px; }
    .password-box { padding: 24px; }
    .selected-tags { gap: 6px; }
    .selected-tag { font-size: .8rem; padding: 4px 10px 4px 12px; }
    .uploaded-files { grid-template-columns: 1fr; }
    .lock-controls { align-items: stretch; width: 100%; }
    .file-status { font-size: .8rem; padding: 12px; }
    .network-link-item { flex-direction: column; align-items: stretch; gap: 10px; }
    .link-info { width: 100%; }
    .link-text { white-space: normal; }
    .link-actions { width: 100%; justify-content: flex-end; }
    .dept-actions { width: 100%; }
    .dept-json-btn { flex: 1; justify-content: center; }
    .dept-note-container { padding: 12px; }
    .approval-section { padding: 16px; }
    .multi-select-dropdown { max-height: 160px; }
}
@media (max-width: 480px) {
    .main-content { padding: 8px; }
    .section { padding: 12px; margin-bottom: 12px; }
    .section-title { font-size: 1rem; }
    .section-icon { width: 36px; height: 36px; font-size: 1rem; }
    .form-input, .form-select, .form-textarea { padding: 12px 16px; font-size: 16px !important; }
    .sixm-table { font-size: .85rem; min-width: 0 !important; width: 100%; }
    .sixm-table th, .sixm-table td { padding: 0; }
    .table-textarea {
        min-height: 48px !important;
        height: 48px;
        padding: 12px 16px;
        font-size: 16px !important;
        border-radius: var(--radius-md);
    }
    .conclusion-card { padding: 16px; }
    .sidebar { padding: 8px 0; }
    .sidebar-header { padding: 0 12px 12px; }
    .logo-text h1 { font-size: 1rem; }
    .theme-toggle { width: 34px; height: 34px; font-size: .85rem; }
    .toast { padding: 10px 14px; font-size: .85rem; }
    .toast-icon { width: 30px; height: 30px; font-size: .9rem; }
    .password-box { padding: 20px; }
    .password-input { font-size: 1.1rem; letter-spacing: 4px; padding: 12px; }
    .modal { padding: 16px; }
    .modal-header h3 { font-size: 1.1rem; }
    .signature-item { padding: 12px; }
    .signature-item .sig-input { padding: 8px 12px; font-size: .85rem; }
    .login-box { padding: 20px; }
    .login-box h3 { font-size: 1.2rem; }
}

@media print {
    .sidebar, .fab-container, .fab-menu, .top-bar, .quick-actions-box, .toast-container, .theme-toggle, .modal-overlay, #confirm-dialog, #password-prompt, .lock-controls, .mobile-nav-select { display: none !important; }
    .app-container { flex-direction: column; max-width: 100%; }
    .main-content { padding: 0; max-height: none; overflow: visible; width: 100%; }
    .section { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; margin-bottom: 15px; padding: 15px; background: #fff !important; color: #000 !important; }
    .sixm-table { min-width: 100%; font-size: 10pt !important; }
    .sixm-table td, .sixm-table th { padding: 6px 4px; border: 1px solid #ccc; }
    body { font-size: 11pt; color: #000; background: #fff; }
    .form-input, .form-select, .form-textarea, .signature-input, .table-textarea, .dept-note-textarea, .sig-input { border: 1px solid #ccc; background: #fff !important; color: #000 !important; pointer-events: none; }
    .selected-tag { background: #e9ecef !important; border-color: #ccc !important; color: #000 !important; }
    .signature-item { border: 1px solid #ccc; background: #f8f9fa !important; }
    @page { size: A4 portrait; margin: 1.5cm; }
    .bottom-tab-bar { display: none !important; }
}

.nav-item, .icon-btn, .icon-btn-sm, .fab, .option-label, .dept-json-btn, .btn-delete-note, .remove-sig, .toast-close, .conclusion-card, .lang-toggle, .theme-toggle { -webkit-tap-highlight-color: transparent; }
.nav-item:active, .icon-btn:active, .fab:active, .dept-json-btn:active, .remove-sig:active { transform: scale(.94); }
.conclusion-card:active { transform: scale(.985); }
.option-label:active { transform: scale(.97); }

.form-group:has(.form-input:focus) .form-label, .form-group:has(.form-select:focus) .form-label, .form-group:has(.form-textarea:focus) .form-label { color: var(--primary-color); }
.form-group:has(.form-input:focus) .form-label i, .form-group:has(.form-select:focus) .form-label i, .form-group:has(.form-textarea:focus) .form-label i { transform: scale(1.15); }
.form-label i { display: inline-block; transition: transform .2s; }
.dept-conclusion-select { transition: all .25s; font-weight: 600; }
.dept-conclusion-select[data-value="approved"] { border-color: var(--success-color); color: var(--success-color); background: rgba(31, 138, 112, 0.08); }
.dept-conclusion-select[data-value="conditionally_approved"] { border-color: var(--warning-color); color: var(--warning-color); background: rgba(192, 122, 30, 0.08); }
.dept-conclusion-select[data-value="rejected"] { border-color: var(--danger-color); color: var(--danger-color); background: rgba(179, 39, 58, 0.08); }

.progress-ring-wrap { display: flex; align-items: center; gap: 16px; }
.progress-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 7; }
.progress-ring .ring-track { stroke: var(--overlay-2); }
.progress-ring .ring-fill { stroke: var(--primary-color); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4, 0, .2, 1); }
.progress-ring .ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 800; color: var(--primary-color); }
.progress-ring-info { display: flex; flex-direction: column; gap: 2px; }
.progress-ring-info .ring-title { font-size: .8rem; color: var(--text-secondary); font-weight: 600; }
.progress-ring-info .ring-sub { font-size: .72rem; color: var(--text-secondary); opacity: .8; }
.progress-ring-mini { width: 38px; height: 38px; }
.progress-ring-mini .ring-label { font-size: .64rem; }

#app-skeleton { position: fixed; inset: 0; z-index: 999999; background: var(--dark-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity .4s ease, visibility .4s ease; }
#app-skeleton.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.skeleton-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow-lg); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-bars { display: flex; flex-direction: column; gap: 10px; width: 220px; }
.skeleton-bar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--overlay-1) 25%, var(--overlay-3) 50%, var(--overlay-1) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.3s ease-in-out infinite; }
.skeleton-bar.w-60 { width: 60%; }
.skeleton-bar.w-80 { width: 80%; align-self: center; }
.skeleton-bar.w-40 { width: 40%; align-self: flex-end; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .7; transform: scale(.94); } }

.tab-content { animation: tab-fade-in .35s ease; }
@keyframes tab-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.bottom-tab-bar { display: none; }
@media (max-width: 1200px) {
    .bottom-tab-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 500; background: var(--glass-bg); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border-top: 1px solid var(--glass-border); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; align-items: stretch; }
    .bottom-tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px; border: none; background: transparent; color: var(--text-secondary); font-family: var(--font-family); cursor: pointer; border-radius: var(--radius-sm); transition: all .2s; position: relative; }
    .bottom-tab-item i { font-size: 1.15rem; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
    .bottom-tab-item span { font-size: .62rem; font-weight: 600; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
    .bottom-tab-item.active { color: var(--primary-color); }
    .bottom-tab-item.active i { transform: translateY(-3px) scale(1.12); }
    .bottom-tab-item.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gradient-primary); }
    .bottom-tab-item:active { transform: scale(.92); }
    .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
    .fab-container { bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media print { .bottom-tab-bar { display: none !important; } }
