* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Verdana, sans-serif; font-size: 13px; line-height: 1.5; color: #1f2937; background: #f3f4f6; }
a { color: #1e3a5f; text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px; min-width: 240px;
    background: linear-gradient(180deg, #0f2540 0%, #1a3a5c 40%, #1e3a5f 100%);
    color: #fff; position: fixed; top: 0; left: 0; bottom: 0;
    overflow-y: auto; z-index: 100;
}
.sidebar-brand {
    padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand-logo {
    font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}
.sidebar-brand-logo span { color: #ff9900; }
.sidebar-brand-sub { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.sidebar-nav { padding: 12px 0; }
.sidebar-nav-section { padding: 6px 18px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); margin-top: 10px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 18px; color: rgba(255,255,255,0.75); font-size: 13px;
    transition: all 0.15s; text-decoration: none;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: rgba(255,153,0,0.15); color: #ff9900; border-right: 3px solid #ff9900; }
.sidebar-nav a .nav-icon { width: 18px; text-align: center; font-size: 14px; }

.main-area { margin-left: 240px; flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: #fff; border-bottom: 1px solid #e5e7eb;
    padding: 0 24px; height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: #1e3a5f; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.topbar-right a { font-size: 12px; color: #6b7280; text-decoration: none; }
.topbar-right a:hover { color: #1e3a5f; }
.topbar-user { font-size: 12px; color: #374151; font-weight: 500; }

.content { padding: 24px; flex: 1; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 8px; padding: 20px;
    border: 1px solid #e5e7eb; position: relative; overflow: hidden;
}
.stat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: #1e3a5f;
}
.stat-card.accent::after { background: #ff9900; }
.stat-card.success::after { background: #10b981; }
.stat-card.warning::after { background: #f59e0b; }
.stat-card.danger::after { background: #ef4444; }
.stat-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; margin-bottom: 6px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: #1e3a5f; }
.stat-card.accent .stat-card-value { color: #ff9900; }
.stat-card.success .stat-card-value { color: #10b981; }
.stat-card.warning .stat-card-value { color: #f59e0b; }

.card {
    background: #fff; border-radius: 8px; border: 1px solid #e5e7eb;
    margin-bottom: 20px; overflow: hidden;
}
.card-header {
    padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600; color: #1e3a5f;
}
.card-body { padding: 18px; }
.card-body-flush { padding: 0; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.admin-table th {
    background: #f9fafb; padding: 10px 14px; text-align: left;
    font-weight: 600; color: #374151; border-bottom: 2px solid #e5e7eb;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
}
table.admin-table td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
table.admin-table tr:hover { background: #f9fafb; }
table.admin-table tr:last-child td { border-bottom: none; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; font-size: 12px; font-weight: 500;
    border: none; border-radius: 6px; cursor: pointer;
    text-decoration: none; transition: all 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn-primary { background: #1e3a5f; color: #fff; }
.btn-primary:hover { background: #2a5a8a; color: #fff; }
.btn-accent { background: #ff9900; color: #fff; }
.btn-accent:hover { background: #e68a00; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-outline { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-control {
    width: 100%; padding: 8px 12px; font-size: 13px;
    font-family: inherit; border: 1px solid #d1d5db;
    border-radius: 6px; background: #fff; color: #1f2937;
    transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
select.form-control { height: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.alert {
    padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
    font-size: 12px; display: flex; align-items: center; gap: 8px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.empty-state {
    text-align: center; padding: 40px 20px; color: #9ca3af;
}
.empty-state p { font-size: 14px; margin-top: 8px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f2540 0%, #1a3a5c 50%, #2a5a8a 100%);
}
.login-box {
    width: 400px; background: #fff; border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden;
}
.login-header {
    background: linear-gradient(135deg, #1a3a5c, #0f2540);
    padding: 30px; text-align: center; color: #fff;
}
.login-header h1 { font-size: 22px; margin-bottom: 4px; }
.login-header h1 span { color: #ff9900; }
.login-header p { font-size: 12px; color: rgba(255,255,255,0.6); }
.login-body { padding: 30px; }

.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; }

.modal-backdrop {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: #fff; border-radius: 10px; width: 500px; max-width: 90%;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 15px; font-weight: 600; color: #1e3a5f;
}
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-area { margin-left: 0; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .login-box { width: 90%; }
}
