:root {
    --sidebar: #0b2440;
    --sidebar-2: #0f3a63;
    --accent: #0ea5a4;
    --accent-2: #38bdf8;
    --page: #eef7fb;
    --card: #ffffff;
    --line: #d7e7ef;
    --muted: #66788a;
    --text: #17212f;
    --danger: #dc3545;
}

* { letter-spacing: 0; }
body {
    background: radial-gradient(circle at top right, rgba(56, 189, 248, .16), transparent 28rem), var(--page);
    color: var(--text);
    font-size: .94rem;
}

a { text-decoration: none; }
.btn { border-radius: 7px; display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.btn-sm { min-height: 31px; }
.icon-btn { width: 31px; padding-left: 0; padding-right: 0; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 276px;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #fff;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 10px 0 28px rgba(12, 38, 67, .16);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; }
.brand-mark, .login-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(14, 165, 164, .28);
}
.brand small { display: block; color: #b6d7ee; font-weight: 500; }
.profile-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    padding: 11px;
}
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(56,189,248,.95);
    font-weight: 700;
    flex: 0 0 auto;
}
.sidebar .nav-link {
    color: #d9ecff;
    border-radius: 8px;
    padding: 9px 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: .92rem;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(255,255,255,.13); color: #fff; }
.sidebar .nav-link i { color: #80d8ff; }
.content { flex: 1; padding: 24px; min-width: 0; }
.impersonation-banner {
    background: #fff8e1;
    border: 1px solid #ffe08a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.page-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; gap: 14px; }
.page-header h1 { font-size: 1.28rem; font-weight: 700; margin: 4px 0 0; display: flex; gap: 8px; align-items: center; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.breadcrumb-lite { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 6px; }
.breadcrumb-lite a { color: #0f6b9f; }
.content-card, .stat-card, .filter-card, .form-section {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(16, 43, 78, .08);
}
.content-card, .filter-card, .form-section { padding: 18px; }
.form-section { margin-bottom: 14px; }
.form-section-title { font-size: .98rem; font-weight: 700; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.stat-card {
    padding: 16px;
    min-height: 122px;
    color: inherit;
    display: block;
    transition: transform .16s ease, box-shadow .16s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(16, 43, 78, .12); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #e7f8fb; color: #0f766e; }
.stat-count { font-size: 1.55rem; font-weight: 700; }
.required::after { content: " *"; color: var(--danger); }
.form-label { font-weight: 600; color: #284256; font-size: .86rem; }
.form-control, .form-select { border-color: #cfe0ea; border-radius: 8px; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .18rem rgba(14,165,164,.16); }
.input-validation-error { border-color: var(--danger) !important; }
.field-validation-error { display: block; color: var(--danger); font-size: .8rem; margin-top: 4px; }
.validation-panel { border: 1px solid #f1b7bd; background: #fff5f6; color: #8f1d2c; border-radius: 8px; padding: 12px; margin-top: 16px; }
.upload-zone { border: 1px dashed #9cc7db; background: #f6fbfd; border-radius: 10px; padding: 12px; }
.upload-zone label { font-weight: 700; color: #23465d; }
.table { font-size: .9rem; }
.table thead th { color: #4c6174; font-size: .78rem; text-transform: uppercase; white-space: nowrap; }
.table td, .table th { vertical-align: middle; }
.sort-link { color: inherit; display: inline-flex; gap: 5px; align-items: center; }
.status-badge { border-radius: 999px; padding: .38rem .58rem; font-size: .76rem; font-weight: 700; }
.status-success { background: #dcfce7; color: #166534; }
.status-danger { background: #ffe4e6; color: #9f1239; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-info { background: #dbeafe; color: #1d4ed8; }
.status-primary { background: #e0f2fe; color: #0369a1; }
.empty-state { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 1.05rem; margin-top: 10px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: #e6f8fb; color: #0f766e; display: grid; place-items: center; margin: 0 auto; font-size: 1.5rem; }
.list-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; color: var(--muted); font-size: .86rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, rgba(15,118,110,.78), rgba(56,189,248,.72)), url('https://images.unsplash.com/photo-1606811971618-4486d14f3f99?auto=format&fit=crop&w=1600&q=80') center/cover; }
.login-panel { width: min(430px, 100%); background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.55); border-radius: 18px; padding: 28px; box-shadow: 0 24px 70px rgba(7, 35, 55, .28); backdrop-filter: blur(18px); }
.login-title { font-size: 1.35rem; font-weight: 750; margin: 16px 0 4px; }
.login-tagline { color: #446272; margin-bottom: 20px; }
.comment-card { background: #f8fcfd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.timeline-item { border-left: 2px solid #38bdf8; padding-left: 14px; margin-bottom: 14px; }

@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar { position: relative; width: 100%; height: auto; }
    .content { padding: 16px; }
    .page-header, .list-footer { align-items: stretch; flex-direction: column; }
}.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.file-preview-card {
    position: relative;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 9px;
    min-width: 0;
}
.file-preview-visual {
    height: 74px;
    border-radius: 8px;
    background: #eef7fb;
    display: grid;
    place-items: center;
    color: #0f766e;
    font-size: 1.8rem;
    overflow: hidden;
}
.file-preview-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-preview-name {
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 7px;
}
.file-preview-size {
    font-size: .74rem;
    color: var(--muted);
}
.file-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #fff;
}
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.attachment-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}
.attachment-thumb {
    height: 96px;
    border-radius: 8px;
    background: #eef7fb;
    display: grid;
    place-items: center;
    color: #0f766e;
    font-size: 2rem;
    overflow: hidden;
}
.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.attachment-name {
    font-weight: 700;
    font-size: .82rem;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
