* {
    box-sizing: border-box;
}

:root {
    --bg-main: #eef3fb;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --primary: #1d4ed8;
    --primary-dark: #0f2f70;
    --primary-soft: #dbeafe;
    --accent: #06b6d4;

    --success-bg: #dcfce7;
    --success-text: #166534;

    --warning-bg: #fef3c7;
    --warning-text: #92400e;

    --danger-bg: #fee2e2;
    --danger-text: #991b1b;

    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius-md: 16px;
    --radius-lg: 24px;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
        linear-gradient(135deg, #eef3fb 0%, #f8fafc 45%, #eef6ff 100%);
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 292px;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #07111f 0%, #0f1f3a 52%, #102a5c 100%);
    color: #ffffff;
    padding: 22px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 10px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 22px;
}

.brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, #2563eb, #06b6d4);
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.brand h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.brand p {
    margin: 4px 0 0;
    color: #b6c6dc;
    font-size: 13px;
}

.sidebar-section-label {
    margin: 20px 10px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8fa7c7;
    font-weight: 800;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 15px;
    color: #dbeafe;
    font-weight: 750;
    transition: 0.2s ease;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(3px);
}

.sidebar nav a.active {
    background: #ffffff;
    color: #102a5c;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    font-size: 14px;
}

.sidebar nav a.active .nav-icon {
    background: var(--primary-soft);
}

.sidebar-user {
    margin-top: 28px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.sidebar-user-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #ffffff;
    font-weight: 900;
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
}

.sidebar-user strong {
    font-size: 15px;
}

.sidebar-user span {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 12px;
}

.sidebar-note {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #b6c6dc;
}

/* Main */
.main-wrap {
    margin-left: 292px;
    width: calc(100% - 292px);
    min-height: 100vh;
}

.topbar {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 34px;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(238, 243, 251, 0.78);
    border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.page-kicker {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.topbar-title {
    margin: 3px 0 0;
    font-size: 22px;
    letter-spacing: -0.035em;
}

.search-box {
    width: min(420px, 42vw);
    position: relative;
}

.search-box input {
    width: 100%;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 999px;
    padding: 13px 18px 13px 44px;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-box span {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: #334155;
    font-weight: 750;
    font-size: 13px;
}

.main {
    padding: 34px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.page-header p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cards */
.card,
.panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-title-row h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.panel-title-row p {
    margin: 5px 0 0;
    color: var(--text-muted);
}

.welcome-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 34px;
    color: #ffffff;
    background:
        radial-gradient(circle at 85% 12%, rgba(6, 182, 212, 0.55), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #123a86 55%, #2563eb 100%);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.welcome-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -70px;
    bottom: -95px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.welcome-hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
}

.welcome-hero h1 {
    margin: 0;
    font-size: 36px;
    letter-spacing: -0.05em;
}

.welcome-hero p {
    color: #dbeafe;
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.7;
}

.hero-actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -42px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 20px;
}

.stat-card span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 34px;
    letter-spacing: -0.04em;
}

.stat-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 850;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    min-height: 42px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.secondary {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.18);
}

.btn.small {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* Forms */
.form {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    font-weight: 800;
    color: #334155;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d9e2ef;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 15px;
    background: #ffffff;
    color: var(--text-main);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 750;
    line-height: 1.5;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 30%),
        linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.auth-card h1 {
    margin: 0 0 8px;
    letter-spacing: -0.04em;
}

.auth-card p {
    color: var(--text-muted);
    margin: 0 0 22px;
}

.auth-link {
    margin-top: 18px;
    text-align: center;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
    font-weight: 850;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 0 14px 8px;
}

.table td {
    background: #ffffff;
    padding: 16px 14px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.table tr td:first-child {
    border-left: 1px solid #e2e8f0;
    border-radius: 16px 0 0 16px;
}

.table tr td:last-child {
    border-right: 1px solid #e2e8f0;
    border-radius: 0 16px 16px 0;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
}

.user-cell strong {
    display: block;
}

.user-cell span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.badge.pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge.approved {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge.rejected {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge.role {
    background: #e0f2fe;
    color: #075985;
}

/* Dashboard sections */
.quick-actions {
    display: grid;
    gap: 14px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    transition: 0.2s ease;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 20px;
}

.quick-action-card strong {
    display: block;
}

.quick-action-card span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 38px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 68px;
    height: 68px;
    border-radius: 24px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 28px;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: end;
}

/* Responsive */
@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-radius: 0 0 26px 26px;
    }

    .main-wrap {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        position: static;
        height: auto;
        padding: 18px 20px;
        align-items: flex-start;
    }

    .topbar-actions {
        display: none;
    }

    .main {
        padding: 20px;
    }

    .welcome-hero {
        padding: 26px;
    }

    .welcome-hero h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        display: block;
    }

    .header-actions {
        margin-top: 14px;
    }
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.folder-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 26px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: 0.2s ease;
}

.folder-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.folder-main-link {
    display: block;
}

.folder-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.folder-icon {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    font-size: 28px;
}

.folder-card h2 {
    margin: 0 0 10px;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.folder-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
    min-height: 50px;
}

.folder-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

.folder-card-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.file-list,
.note-list {
    display: grid;
    gap: 12px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}

.file-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    font-size: 22px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-info strong {
    display: block;
    word-break: break-word;
}

.file-info span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.note-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

.note-card h3 {
    margin: 0 0 8px;
}

.note-card p {
    margin: 0;
    color: #334155;
    line-height: 1.6;
}

.note-card span {
    display: block;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 1100px) {
    .folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .folder-grid {
        grid-template-columns: 1fr;
    }

    .file-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.file-image-preview {
    display: block;
    width: 100%;
    max-width: 220px;
    max-height: 140px;
    object-fit: cover;
    border-radius: 14px;
    margin: 10px 0;
    border: 1px solid var(--border);
}

.file-info small {
    display: block;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.note-footer span {
    margin-top: 0;
}

.note-delete-link {
    color: #dc2626;
    font-size: 13px;
    font-weight: 850;
}

.note-delete-link:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .file-actions {
        justify-content: flex-start;
    }
}

.activity-timeline {
    position: relative;
    display: grid;
    gap: 14px;
}

.activity-item {
    display: flex;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 15px;
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
    flex: 0 0 auto;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.activity-title-row strong {
    display: block;
    color: var(--text-main);
}

.activity-title-row span {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.activity-content p {
    margin: 6px 0 0;
    color: #334155;
    line-height: 1.5;
}

.activity-content small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-weight: 700;
}

@media (max-width: 700px) {
    .activity-title-row {
        display: block;
    }

    .activity-title-row span {
        display: block;
        margin-top: 4px;
    }
}

.subfolder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.subfolder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    transition: 0.2s ease;
}

.subfolder-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.subfolder-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    font-size: 23px;
}

.subfolder-card strong {
    display: block;
    color: var(--text-main);
}

.subfolder-card span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.page-kicker a {
    color: var(--primary);
    font-weight: 900;
}

@media (max-width: 1100px) {
    .subfolder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .subfolder-grid {
        grid-template-columns: 1fr;
    }
}

/* Folder Tree View */
.tree-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.tree-toolbar h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #0f172a;
}

.tree-toolbar p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.tree-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.folder-tree-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
    overflow-x: auto;
}

.folder-tree-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.folder-tree-list .folder-tree-list {
    margin-top: 10px;
    padding-left: 34px;
    border-left: 2px dashed #cbd5e1;
}

.folder-tree-item {
    margin-bottom: 10px;
}

.folder-tree-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    transition: 0.2s ease;
}

.folder-tree-row:hover {
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.folder-tree-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.folder-tree-toggle,
.folder-tree-toggle-spacer {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
}

.folder-tree-toggle {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
}

.folder-tree-toggle:hover {
    background: #e0f2fe;
    border-color: #38bdf8;
}

.folder-tree-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 22px;
}

.folder-tree-info {
    min-width: 0;
}

.folder-tree-name {
    display: inline-block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 4px;
}

.folder-tree-name:hover {
    color: #2563eb;
}

.folder-tree-info p {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.folder-tree-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.folder-tree-meta span {
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.folder-tree-actions {
    flex: 0 0 auto;
}

.folder-tree-children {
    margin-top: 10px;
}

.folder-tree-children.is-collapsed {
    display: none;
}

.folder-tree-item.is-collapsed > .folder-tree-row .folder-tree-icon {
    background: #fef3c7;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

.btn-small:hover {
    background: #2563eb;
}

.empty-state {
    text-align: center;
    padding: 42px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: #0f172a;
}

.empty-state p {
    margin: 0 0 18px;
    color: #64748b;
}

@media (max-width: 768px) {
    .tree-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-tree-wrap {
        padding: 12px;
    }

    .folder-tree-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-tree-actions {
        width: 100%;
    }

    .folder-tree-actions .btn-small {
        width: 100%;
    }

    .folder-tree-list .folder-tree-list {
        padding-left: 18px;
    }
}

/* Folder Tree page layout fix */
.albis-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px;
}

.albis-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.albis-page .page-header h1 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.2;
}

.albis-page .page-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.albis-page .page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.albis-page .content-card {
    width: 100%;
}

@media (max-width: 768px) {
    .albis-page {
        padding: 18px;
    }

    .albis-page .page-header {
        flex-direction: column;
    }

    .albis-page .page-actions {
        width: 100%;
    }

    .albis-page .page-actions a {
        width: 100%;
        text-align: center;
    }
}

/* Folder Tree button polish */
.albis-page .btn-primary,
.albis-page .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.albis-page .btn-primary {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
}

.albis-page .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.albis-page .btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.albis-page .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.tree-toolbar-actions button.btn-secondary {
    font-family: inherit;
}

/* Make tree toolbar align cleaner */
.tree-toolbar {
    background: transparent;
    padding: 0;
}

.tree-toolbar-actions {
    margin-top: 4px;
}

/* Improve folder tree spacing */
.folder-tree-wrap {
    margin-top: 18px;
}

.folder-tree-row {
    min-height: 92px;
}

.folder-tree-main {
    align-items: center;
}

.folder-tree-icon {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

/* Folder breadcrumbs */
.folder-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #64748b;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.folder-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

.folder-breadcrumb a:hover {
    text-decoration: underline;
}

.folder-breadcrumb strong {
    color: #0f172a;
    font-weight: 800;
}

.breadcrumb-separator {
    color: #94a3b8;
    font-weight: 700;
}

/* Folder View Summary Cards */
.folder-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.folder-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.folder-summary-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: #eff6ff;
    color: #2563eb;
    display: grid;
    place-items: center;
    font-size: 22px;
    flex: 0 0 46px;
}

.folder-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.folder-summary-card strong {
    display: block;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
}

.folder-summary-action {
    justify-content: space-between;
    grid-column: span 2;
}

.folder-summary-action strong {
    font-size: 18px;
}

@media (max-width: 1100px) {
    .folder-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .folder-summary-action {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .folder-summary-grid {
        grid-template-columns: 1fr;
    }

    .folder-summary-action {
        grid-column: span 1;
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-summary-action .btn {
        width: 100%;
        justify-content: center;
    }
}

.inline-delete-form {
    display: inline-flex;
    margin: 0;
}

.topbar-actions {
    flex-wrap: wrap;
}

.btn.danger {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
}

.btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Folder search and filter */
.folder-filter-panel {
    margin-bottom: 22px;
}

.folder-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.7fr) auto;
    gap: 14px;
    align-items: end;
}

.folder-filter-form .form-group {
    margin: 0;
}

.folder-filter-form input,
.folder-filter-form select {
    width: 100%;
}

.folder-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.folder-filter-result {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.folder-filter-result strong {
    color: #0f172a;
}

.folder-created-by {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .folder-filter-form {
        grid-template-columns: 1fr;
    }

    .folder-filter-actions {
        width: 100%;
    }

    .folder-filter-actions .btn {
        flex: 1;
        justify-content: center;
    }
}


/* Folder tree search */
.folder-tree-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin: 20px 0 10px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.folder-tree-search-form .form-group {
    margin: 0;
}

.folder-tree-search-form input {
    width: 100%;
}

.folder-tree-search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.folder-tree-search-result {
    margin: 10px 0 16px;
    color: #64748b;
    font-size: 14px;
}

.folder-tree-search-result strong {
    color: #0f172a;
}

@media (max-width: 760px) {
    .folder-tree-search-form {
        grid-template-columns: 1fr;
    }

    .folder-tree-search-actions {
        width: 100%;
    }

    .folder-tree-search-actions .btn-primary,
    .folder-tree-search-actions .btn-secondary {
        flex: 1;
    }
}

/* Dashboard recent files and activity polish */
.recent-file-list {
    display: grid;
    gap: 12px;
}

.recent-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.recent-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eff6ff;
    display: grid;
    place-items: center;
    font-size: 22px;
    flex: 0 0 46px;
}

.recent-file-info {
    min-width: 0;
    flex: 1;
}

.recent-file-info strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-word;
}

.recent-file-info span,
.recent-file-info small {
    display: block;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.recent-file-info a,
.table-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.recent-file-info a:hover,
.table-link:hover {
    text-decoration: underline;
}

.activity-table td {
    vertical-align: middle;
}

.activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.activity-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.activity-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.activity-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.activity-badge.neutral {
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 700px) {
    .recent-file-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .recent-file-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* My Access page */
.access-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.access-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.access-summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.access-summary-card strong {
    display: block;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 8px;
}

.access-summary-card small {
    color: #64748b;
    font-size: 13px;
}

.access-search-panel {
    margin-bottom: 22px;
}

.access-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.access-search-form .form-group {
    margin: 0;
}

.access-search-form input {
    width: 100%;
}

.access-search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.access-table td {
    vertical-align: middle;
}

.access-folder-cell strong,
.access-folder-cell span,
.access-folder-cell small {
    display: block;
}

.access-folder-cell strong {
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 4px;
}

.access-folder-cell span {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.access-folder-cell small {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.permission-pill {
    display: inline-flex;
    justify-content: center;
    min-width: 48px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.permission-pill.yes {
    background: #dcfce7;
    color: #166534;
}

.permission-pill.no {
    background: #f1f5f9;
    color: #64748b;
}

@media (max-width: 1100px) {
    .access-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .access-summary-grid {
        grid-template-columns: 1fr;
    }

    .access-search-form {
        grid-template-columns: 1fr;
    }

    .access-search-actions {
        width: 100%;
    }

    .access-search-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Global search page */
.global-search-panel {
    margin-bottom: 22px;
}

.global-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.global-search-form .form-group {
    margin: 0;
}

.global-search-form input {
    width: 100%;
}

.global-search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.global-search-summary {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.global-search-summary strong {
    color: #0f172a;
}

.search-results-panel {
    margin-bottom: 22px;
}

.search-result-list {
    display: grid;
    gap: 12px;
}

.search-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.search-result-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eff6ff;
    display: grid;
    place-items: center;
    font-size: 22px;
    flex: 0 0 46px;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info strong,
.search-result-info span,
.search-result-info small {
    display: block;
}

.search-result-info strong {
    color: #0f172a;
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-word;
}

.search-result-info span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.search-result-info small {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

.search-result-info a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.search-result-info a:hover {
    text-decoration: underline;
}

.mini-empty {
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 760px) {
    .global-search-form {
        grid-template-columns: 1fr;
    }

    .global-search-actions {
        width: 100%;
    }

    .global-search-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .search-result-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-result-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* File view page */
.file-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
    gap: 22px;
    align-items: start;
}

.file-preview-panel,
.file-details-panel {
    min-height: 300px;
}

.file-preview-image-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
}

.file-preview-image-wrap img {
    max-width: 100%;
    max-height: 650px;
    border-radius: 14px;
    object-fit: contain;
}

.file-preview-pdf-wrap {
    height: 720px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
}

.file-preview-pdf-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.file-detail-list {
    display: grid;
    gap: 12px;
}

.file-detail-row {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.file-detail-row span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 6px;
}

.file-detail-row strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    word-break: break-word;
}

.file-detail-row a {
    color: #2563eb;
    text-decoration: none;
}

.file-detail-row a:hover {
    text-decoration: underline;
}

@media (max-width: 1000px) {
    .file-view-grid {
        grid-template-columns: 1fr;
    }

    .file-preview-pdf-wrap {
        height: 520px;
    }
}

/* Text file preview */
.file-preview-text-wrap {
    background: #0f172a;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #1e293b;
}

.file-preview-text-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #111827;
    border-bottom: 1px solid #1f2937;
}

.file-preview-text-header strong {
    color: #ffffff;
    font-size: 14px;
}

.file-preview-text-header span {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.file-preview-text-wrap pre {
    margin: 0;
    padding: 18px;
    max-height: 680px;
    overflow: auto;
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.file-preview-text-wrap code {
    font-family: Consolas, Monaco, "Courier New", monospace;
}

/* File edit page */
.file-edit-note {
    margin: 16px 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.file-edit-note strong {
    color: #0f172a;
}

.file-edit-panel {
    max-width: 980px;
}

.replace-file-box {
    margin-top: 24px;
    padding: 22px;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: #f8fafc;
}

.replace-file-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #0f172a;
}

.replace-file-box p {
    margin: 0 0 18px;
    color: #64748b;
    line-height: 1.6;
}

.current-file-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.current-file-summary div {
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.current-file-summary span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 13px;
}

.current-file-summary strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    word-break: break-word;
}

.albis-form small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 800px) {
    .current-file-summary {
        grid-template-columns: 1fr;
    }
}

.file-version-panel {
    margin-top: 24px;
}

.version-count {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
}

.version-list {
    display: grid;
    gap: 14px;
}

.version-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
}

.version-main {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.version-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: #f1f5f9;
    color: #0f172a;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.version-main h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 16px;
}

.version-main p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.version-note {
    margin-top: 8px !important;
    color: #334155 !important;
}

.version-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.version-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.version-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .version-card {
        grid-template-columns: 1fr;
    }

    .version-meta,
    .version-actions {
        justify-content: flex-start;
    }
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.version-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn.warning {
    background: #f59e0b;
    color: #ffffff;
    border: 1px solid #f59e0b;
    box-shadow: 0 12px 25px rgba(245, 158, 11, 0.25);
}

.btn.warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.btn.danger {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
    box-shadow: 0 12px 25px rgba(220, 38, 38, 0.22);
}

.btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.approval-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.approval-approved {
    background: #dcfce7;
    color: #166534;
}

.approval-pending {
    background: #fef3c7;
    color: #92400e;
}

.approval-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.pending-help-text {
    margin: 8px 0 0;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.approval-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.approval-approved {
    background: #dcfce7;
    color: #166534;
}

.approval-pending {
    background: #fef3c7;
    color: #92400e;
}

.approval-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.pending-help-text {
    margin: 8px 0 0;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.approval-filter-card {
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

.approval-filter-card:hover,
.approval-filter-card.active {
    transform: translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14);
}

.approval-list {
    display: grid;
    gap: 16px;
}

.approval-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
}

.approval-card-main {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.approval-card-main h3 {
    margin: 0 0 8px;
    color: #0f172a;
}

.approval-card-main p {
    margin: 8px 0 0;
    color: #64748b;
    line-height: 1.5;
}

.approval-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    max-width: 380px;
}

.approval-reject-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.approval-reject-form input[type="text"] {
    min-width: 190px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid #dbe4f0;
    outline: none;
}

.approval-note {
    font-size: 13px;
    color: #475569 !important;
}

.danger-text {
    color: #991b1b !important;
}

@media (max-width: 900px) {
    .approval-card {
        grid-template-columns: 1fr;
    }

    .approval-card-actions {
        justify-content: flex-start;
        max-width: none;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 6px;
}

.status-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.forgot-password-link {
    text-align: right;
    margin-top: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.forgot-password-link a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.forgot-password-link {
    text-align: right;
    margin-top: 12px;
    margin-bottom: 22px;
    font-size: 14px;
}

.forgot-password-link a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.auth-link {
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

.auth-link a {
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.folder-admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    color: #1d4ed8;
    white-space: nowrap;
}

.folder-admin-toggle input {
    width: 16px;
    height: 16px;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}


.file-preview-box {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.file-view-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    background: #f8fafc;
}

.file-pdf-preview {
    width: 100%;
    min-height: 620px;
    border: 0;
    background: #ffffff;
}

.file-text-preview {
    margin: 0;
    padding: 18px;
    max-height: 620px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.6;
    color: #0f172a;
}

.alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.folder-badge-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.badge.folder-admin {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge.subfolder {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.badge.pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge.rejected {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.folder-parent-line {
    color: #6b7280;
    font-size: 13px;
    margin: -4px 0 10px;
}

.folder-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}

@media (max-width: 700px) {
    .folder-badge-stack {
        align-items: flex-start;
    }
}


.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin: 14px 0;
}

.folder-tree-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.folder-tree-subfolder-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.folder-tree-parent-line {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.folder-tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-small.secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-small.secondary:hover {
    background: #e2e8f0;
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.folder-admin-summary {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.folder-admin-access-row {
    background: #f0fdf4;
}

.folder-admin-help {
    color: #047857 !important;
    font-weight: 600;
}

.access-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 800px) {
    .access-action-stack {
        flex-direction: column;
    }

    .access-action-stack .btn {
        width: 100%;
        justify-content: center;
    }
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.folder-admin-stat-card {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.folder-admin-action-card {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.folder-admin-dashboard-panel {
    border-color: #a7f3d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.folder-admin-dashboard-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.folder-admin-dashboard-summary div {
    background: #ffffff;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 16px;
}

.folder-admin-dashboard-summary strong {
    display: block;
    font-size: 26px;
    color: #047857;
    margin-bottom: 4px;
}

.folder-admin-dashboard-summary span {
    display: block;
    color: #475569;
    font-size: 13px;
}

@media (max-width: 800px) {
    .folder-admin-dashboard-summary {
        grid-template-columns: 1fr;
    }
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.folder-tree-subfolder-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.search-action-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 700px) {
    .search-action-stack {
        justify-content: flex-start;
        width: 100%;
    }

    .search-action-stack .btn {
        width: 100%;
        justify-content: center;
    }
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.folder-admin-stat-card {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.folder-admin-upload-row {
    background: #f0fdf4;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.folder-admin-note {
    color: #047857;
    font-weight: 600;
}

.auto-approved-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-top: 6px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.rejection-reason-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #7f1d1d;
    max-width: 520px;
}

.upload-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 800px) {
    .upload-action-stack {
        flex-direction: column;
    }

    .upload-action-stack .btn {
        width: 100%;
        justify-content: center;
    }
}

.folder-admin-stat-card {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.folder-admin-user-row {
    background: #f0fdf4;
}

.folder-admin-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.folder-access-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.folder-access-cell small {
    color: #475569;
}

.user-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 800px) {
    .user-filter-form {
        grid-template-columns: 1fr;
    }

    .user-action-stack {
        flex-direction: column;
    }

    .user-action-stack .btn {
        width: 100%;
        justify-content: center;
    }
}

.drag-upload-form {
    width: 100%;
}

.drag-upload-box {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.drag-upload-box:hover,
.drag-upload-box.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
}

.drag-upload-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #e0edff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.drag-upload-box h3 {
    margin: 0 0 6px;
    color: #0f172a;
}

.drag-upload-box p {
    margin: 0 0 10px;
    color: #475569;
}

.drag-upload-box small {
    color: #64748b;
    display: block;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.5;
}

.selected-files {
    margin-top: 18px;
    display: grid;
    gap: 8px;
    text-align: left;
}

.selected-file-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #334155;
    font-weight: 700;
}

.selected-file-pill span {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .drag-upload-box {
        padding: 22px 16px;
    }

    .selected-file-pill {
        flex-direction: column;
        align-items: flex-start;
    }
}

.selected-file-pill > div {
    display: grid;
    gap: 2px;
}

.selected-file-remove {
    border: 0;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    cursor: pointer;
}

.selected-file-remove:hover {
    background: #fecaca;
}