/* =========================================================
   ICT Books Work Management Database — Advanced UI Styles
   ========================================================= */

@font-face {
    font-family: 'CustomBanglaFont';
    src: url('font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-app: #f3f6fc;
    --bg-surface: #ffffff;
    --bg-subtle: #eef2fa;
    --bg-sidebar: #161b33;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.09);
    --bg-sidebar-active: linear-gradient(135deg, #4f46e5, #0ea5e9);
    --text-main: #182036;
    --text-muted: #5a657d;
    --text-inverse: #f8fafc;
    --border-color: #dde4f2;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #0ea5e9;
    --whatsapp: #16a34a;
    --whatsapp-hover: #15803d;
    --danger: #dc2626;
    --shadow-sm: 0 2px 8px rgba(20, 28, 58, 0.06);
    --shadow-md: 0 10px 28px rgba(20, 28, 58, 0.09);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.22);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --bg-app: #0c1020;
    --bg-surface: #141a2e;
    --bg-subtle: #1c2440;
    --bg-sidebar: #0a0e1b;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --text-main: #eef2ff;
    --text-muted: #9aa7c7;
    --border-color: #263152;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, input, button, select, textarea {
    font-family: 'CustomBanglaFont', 'Segoe UI', Tahoma, sans-serif;
}

/* Preserve normal weight for Bangla custom font without breaking FontAwesome icons */
body, h1, h2, h3, h4, h5, h6, strong, b, button, a, span, p, li, label, input {
    font-weight: normal !important;
}

.fa-solid, .fas {
    font-weight: 900 !important;
}
.fa-regular, .far, .fa-brands, .fab {
    font-weight: 400 !important;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.25s ease, color 0.25s ease;
}

[hidden] {
    display: none !important;
}

/* --- TOPBAR --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s;
}

.brand:hover {
    opacity: 0.88;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.32);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topbar-center {
    flex: 1;
    max-width: 440px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box > i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-clear {
    position: absolute;
    right: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.icon-btn.unlocked {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.1);
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-chip:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.avatar-mini, .avatar-sm, .avatar-lg, .avatar-xl {
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.avatar-img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 50%;
    z-index: 2;
}

.avatar-fallback {
    position: relative;
    z-index: 1;
}

.avatar-mini { width: 28px; height: 28px; font-size: 0.78rem; }
.avatar-sm { width: 34px; height: 34px; font-size: 0.85rem; }
.avatar-lg { width: 54px; height: 54px; font-size: 1.25rem; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35); }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; border: 4px solid var(--bg-surface); margin-top: -36px; box-shadow: var(--shadow-md); }

.profile-chip-text {
    font-size: 0.9rem;
}

.mobile-only {
    display: none;
}

/* --- BREADCRUMB BAR --- */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.92rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.crumb-link:hover, .crumb-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.09);
}

.crumb-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.crumb-current {
    font-size: 0.92rem;
    color: var(--text-main);
    padding: 4px 8px;
}

.breadcrumb-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* --- HOME VIEW --- */
.home-view {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.home-hero {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 24px;
    margin-bottom: 34px;
}

.hero-main {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #0c4a6e 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.hero-main::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.14);
    padding: 5px 12px;
    border-radius: 999px;
    width: fit-content;
    margin-bottom: 14px;
}

.hero-main h1 {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 10px;
}

.hero-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 22px;
    max-width: 560px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.35rem;
    color: #ffffff;
}

.stat-label {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.78);
}

/* Home Profile Card */
.hero-profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.profile-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-role-badge {
    display: inline-block;
    font-size: 0.76rem;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.12);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.profile-identity h2 {
    font-size: 1.3rem;
    color: var(--text-main);
    line-height: 1.25;
}

.profile-id-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-contact-row {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-item > i {
    font-size: 1.5rem;
    color: var(--whatsapp);
}

.contact-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.contact-value {
    font-size: 1.05rem;
    color: var(--text-main);
    letter-spacing: 0.4px;
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.btn-whatsapp, .btn-primary, .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-whatsapp {
    flex: 1;
    background: var(--whatsapp);
    color: #fff;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline.icon-only {
    width: 42px;
    padding: 0;
}

.full-width {
    width: 100%;
}

/* Section Header & Books Grid */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.section-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.count-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-size: 0.85rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #0ea5e9);
    opacity: 0.85;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.book-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.book-folder-badge {
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.book-card-title {
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--text-main);
    word-break: break-word;
}

.book-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--primary);
}

/* --- WORKSPACE VIEW (BOOK -> CHAPTERS) --- */
.workspace-view {
    display: flex;
    min-height: calc(100vh - 110px);
}

.sidebar {
    width: 300px;
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-top {
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-books-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 14px;
    transition: background 0.2s;
}

.back-books-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.active-book-banner {
    background: rgba(79, 70, 229, 0.22);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
}

.active-book-label {
    font-size: 0.76rem;
    color: #a5b4fc;
    display: block;
}

.active-book-banner h2 {
    font-size: 1.15rem;
    color: #fff;
    margin: 3px 0;
    word-break: break-word;
}

.sidebar-count {
    font-size: 0.82rem;
    color: #cbd5e1;
}

.sidebar-chapters-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
}

.sidebar-section-title {
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0 6px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chapter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.98rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.chapter-item i {
    color: #38bdf8;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.chapter-item:hover {
    background: var(--bg-sidebar-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.chapter-item.active {
    background: var(--bg-sidebar-active);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.38);
}

.chapter-item.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-profile-mini:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mini-info {
    flex: 1;
    min-width: 0;
}

.mini-name {
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-meta {
    font-size: 0.74rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-arrow {
    color: #94a3b8;
    font-size: 0.78rem;
}

/* --- MAIN CONTENT --- */
.content {
    flex: 1;
    padding: 28px 34px 60px;
    min-width: 0;
}

.book-root-section {
    margin-bottom: 28px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.chapter-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.chapter-eyebrow {
    font-size: 0.85rem;
    color: var(--primary);
    display: block;
    margin-bottom: 2px;
}

#chapter-title {
    font-size: 1.7rem;
    color: var(--text-main);
    line-height: 1.25;
}

.chapter-quick-stats {
    display: flex;
    gap: 10px;
}

.mini-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Filter Pills */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.filter-pill {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.block-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 0 14px;
}

.block-heading h3 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 1.2rem;
    color: var(--text-main);
}

.block-heading h3 i {
    color: var(--primary);
}

/* Document Cards Grid */
.doc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 14px;
    list-style: none;
    margin-bottom: 28px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    background: var(--bg-surface);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.doc-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.doc-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.doc-info {
    min-width: 0;
    flex: 1;
}

.doc-name {
    display: block;
    font-size: 1rem;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.3;
}

.doc-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-dl-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Icon Colors */
.icon-pdf { color: #dc2626; }
.icon-word { color: #2563eb; }
.icon-ai { color: #ea580c; }
.icon-excel { color: #16a34a; }
.icon-ppt { color: #d97706; }
.icon-code { color: #7c3aed; }
.icon-default { color: #64748b; }

/* Exclusive Master File (ZIP/RAR) */
.doc-card.master-file {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    color: #78350f;
    grid-column: 1 / -1;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .doc-card.master-file {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(180, 83, 9, 0.22));
    color: #fef3c7;
}

.doc-card.master-file .doc-name {
    color: inherit;
    font-size: 1.08rem;
}

.doc-card.master-file .doc-meta {
    color: inherit;
    opacity: 0.8;
}

.doc-card.master-file .doc-icon-wrap {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

/* Image Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 18px;
}

.gallery-folder-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
    color: var(--primary);
    font-size: 1.05rem;
}

.image-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.image-thumb-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-subtle);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-filename {
    font-size: 0.88rem;
    color: var(--text-main);
    word-break: break-word;
    text-align: center;
}

.image-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.copy-btn {
    flex: 1;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.img-dl-btn {
    width: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.img-dl-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Empty & Error States */
.empty-state, .status-card {
    grid-column: 1 / -1;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.empty-state h2, .status-card h3 {
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.status-card-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 14, 27, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-card {
    padding: 28px 24px;
    text-align: center;
}

.modal-icon-circle {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.14);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 8px 0 18px;
}

.password-input-wrap {
    position: relative;
    margin-bottom: 12px;
}

.password-input-wrap input {
    width: 100%;
    padding: 11px 42px 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

.password-input-wrap input:focus {
    border-color: var(--primary);
}

.pw-vis-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.auth-error {
    color: var(--danger);
    font-size: 0.88rem;
    margin-bottom: 10px;
}

/* Profile Modal */
.profile-modal-banner {
    height: 84px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
}

.profile-modal-card .modal-close {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.profile-modal-body {
    padding: 0 24px 24px;
    text-align: center;
}

.profile-modal-body h2 {
    margin-top: 10px;
    font-size: 1.4rem;
}

.profile-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.profile-details-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin-bottom: 18px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
}

.detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(79, 70, 229, 0.14);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.detail-icon.whatsapp {
    background: rgba(22, 163, 74, 0.14);
    color: var(--whatsapp);
}

.detail-content {
    flex: 1;
}

.detail-label {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 1rem;
    color: var(--text-main);
}

.mini-copy-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.mini-copy-btn:hover {
    background: var(--border-color);
    color: var(--primary);
}

.profile-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Lightbox */
.lightbox-card {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.lightbox-title {
    font-size: 0.98rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-body {
    padding: 18px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
}

.lightbox-body img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 8px;
    object-fit: contain;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #182036;
    color: #fff;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.25s ease;
}

.toast.success i { color: #4ade80; }
.toast.error i { color: #f87171; }
.toast.info i { color: #38bdf8; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 980px) {
    .home-hero {
        grid-template-columns: 1fr;
    }
    .hide-md {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 10px 14px;
        flex-wrap: wrap;
    }
    .topbar-center {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .hide-sm {
        display: none;
    }
    .mobile-only {
        display: inline-flex;
    }
    .breadcrumb-bar {
        padding: 8px 14px;
    }
    .home-view {
        padding: 18px 14px 48px;
    }
    .hero-main {
        padding: 22px 18px;
    }
    .hero-main h1 {
        font-size: 1.55rem;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(10, 14, 27, 0.55);
    }
    .content {
        padding: 18px 14px 48px;
    }
}
