/* AntiPhishing Gov Br - Dark Theme */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1e1e3a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --border: #2a2a3e;
    --shadow: rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar .logo {
    padding: 0 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.sidebar .logo h1 { font-size: 1rem; color: var(--accent); font-weight: 700; }
.sidebar .logo p { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.sidebar nav { flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}
.sidebar .footer-menu {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* Main Content */
.main {
    margin-left: 220px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 220px);
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h2 { color: var(--accent); font-size: 1.3rem; }
.page-header .subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #1a1a2e; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}
tbody td {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-completed { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-processing { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-pending { background: rgba(100,116,139,0.15); color: var(--text-muted); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}
.modal h3 { color: var(--accent); margin-bottom: 1.5rem; font-size: 1.1rem; }
.modal .close {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal .close:hover { color: var(--text-primary); }

/* Form */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}
.form-group .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-group .file-info { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Detail Modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.detail-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
}
.detail-item .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item .value { font-size: 0.9rem; color: var(--text-primary); margin-top: 4px; font-weight: 500; }
.detail-item .value.danger { color: var(--red); }
.detail-item .value.success { color: var(--green); }
.detail-full { grid-column: 1 / -1; }

/* Download links */
.download-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.download-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.download-links a:hover { border-color: var(--accent); color: var(--accent); }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s;
    box-shadow: 0 4px 12px var(--shadow);
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 0.9rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .logo h1, .sidebar .logo p, .sidebar nav a span { display: none; }
    .sidebar nav a { justify-content: center; padding: 0.75rem; font-size: 1.2rem; }
    .main { margin-left: 60px; max-width: calc(100vw - 60px); padding: 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
