* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F8F9FC;
    color: #1A1A2E;
    font-size: 14px;
}

.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 220px;
    background: #1a2f6e;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100vh;
}

nav { padding: 12px 0; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #FFFFFF;
    font-weight: 500;
    border-left-color: #C9A84C;
}

.nav-item svg {
    width: 15px;
    height: 15px;
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-item.active svg { opacity: 1; }

.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #F8F9FC;
}

.topbar {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E6F0;
    padding: 13px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar h1 { font-size: 16px; font-weight: 600; color: #1A1A2E; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 20px 26px; flex: 1; }

.card {
    background: #FFFFFF;
    border: 1px solid #E2E6F0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid #E2E6F0;
    border-radius: 10px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #1B3068;
    border-radius: 10px 10px 0 0;
}

.stat-label {
    font-size: 10px;
    color: #8A90A8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #1A1A2E;
    line-height: 1;
}

.stat-sub { font-size: 11px; color: #8A90A8; margin-top: 5px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
}

.btn:hover { opacity: 0.88; }
.btn-primary { background: #1B3068; color: #ffffff; }
.btn-primary:hover { background: #2A4494; opacity: 1; }
.btn-secondary { background: #FFFFFF; color: #4A5068; border: 1px solid #E2E6F0; }
.btn-secondary:hover { background: #F8F9FC; opacity: 1; }
.btn-success { background: #E8F5EE; color: #1A6B4A; border: 1px solid #B8DFC9; }
.btn-danger { background: #FAEAEA; color: #A32020; border: 1px solid #F0C0C0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #4A5068;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #E2E6F0;
    border-radius: 6px;
    font-size: 13px;
    color: #1A1A2E;
    background: #FFFFFF;
    transition: border-color 0.15s;
}

.form-control:focus { outline: none; border-color: #1B3068; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.table-wrap {
    background: #FFFFFF;
    border: 1px solid #E2E6F0;
    border-radius: 10px;
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #8A90A8;
    background: #F8F9FC;
    border-bottom: 1px solid #E2E6F0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr { border-bottom: 1px solid #EEF1F8; transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F5F7FC; cursor: pointer; }
td { padding: 10px 14px; color: #1A1A2E; vertical-align: middle; }

.filters-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }

.filter-select {
    font-size: 12px;
    color: #4A5068;
    background: #FFFFFF;
    border: 1px solid #E2E6F0;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
}

.search-input {
    flex: 1;
    min-width: 220px;
    font-size: 13px;
    padding: 7px 12px;
    border: 1px solid #E2E6F0;
    border-radius: 6px;
    background: #FFFFFF;
    color: #1A1A2E;
}

.search-input:focus { outline: none; border-color: #1B3068; }
.filter-select:focus { outline: none; border-color: #1B3068; }

.tab-bar { display: flex; border-bottom: 2px solid #E2E6F0; margin-bottom: 18px; }

.tab {
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
    color: #8A90A8;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.tab:hover { color: #1B3068; }
.tab.active { color: #1B3068; font-weight: 600; border-bottom-color: #1B3068; }

.alert { padding: 11px 15px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; font-weight: 500; }
.alert-error { background: #FAEAEA; color: #A32020; border: 1px solid #F0C0C0; }
.alert-success { background: #E8F5EE; color: #1A6B4A; border: 1px solid #B8DFC9; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,20,50,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: #FFFFFF;
    border-radius: 12px;
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    box-shadow: 0 20px 60px rgba(10,20,50,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E2E6F0;
}

.modal-title { font-size: 15px; font-weight: 600; color: #1B3068; }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #8A90A8;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1;
}

.modal-close:hover { color: #1A1A2E; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #E2E6F0;
}

.note-item {
    background: #F8F9FC;
    border-radius: 8px;
    padding: 13px 15px;
    margin-bottom: 10px;
    border: 1px solid #EEF1F8;
    border-left: 3px solid #1B3068;
}

.note-meta { font-size: 11px; color: #8A90A8; margin-bottom: 6px; font-weight: 500; }
.note-text { font-size: 13px; color: #1A1A2E; line-height: 1.6; }

.activity-item { display: flex; gap: 10px; margin-bottom: 13px; align-items: flex-start; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2A4494;
    margin-top: 5px;
    flex-shrink: 0;
    opacity: 0.5;
}

.activity-text { font-size: 12px; color: #4A5068; line-height: 1.5; }
.activity-time { font-size: 11px; color: #8A90A8; margin-top: 2px; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2f6e;
}

.login-box {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 40px 38px;
    width: 400px;
    box-shadow: 0 30px 80px rgba(10,20,50,0.35);
}

.login-logo { text-align: center; margin-bottom: 30px; }

.login-logo h1 {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    color: #1B3068;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-logo p {
    font-size: 11px;
    color: #8A90A8;
    margin-top: 5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-logo .logo-divider {
    width: 40px;
    height: 2px;
    background: #C9A84C;
    margin: 10px auto;
    border-radius: 2px;
}

.empty-state { text-align: center; padding: 40px; color: #8A90A8; font-size: 13px; }
.page-count { font-size: 12px; color: #8A90A8; margin-top: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-field { margin-bottom: 12px; }

.detail-label {
    font-size: 10px;
    color: #8A90A8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-value { font-size: 13px; color: #1A1A2E; font-weight: 500; }
.text-muted { color: #8A90A8; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.lead-code {
    font-family: monospace;
    font-size: 11px;
    background: #EBF0FA;
    color: #1B3068;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid #D0D8F0;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E2E6F0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #C0C8D8; }