/* Core Variables */
:root {
    --primary: #6f00ff;
    --primary-hover: #5500cc;
    --bg-dark: #121212;
    --bg-card: #1f1f2f;
    --bg-input: #12121c;
    --text-main: #f5f5f5;
    --text-muted: #a0aec0;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --border: #2d2d3d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.dark {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #0d0d14;
    padding-top: 20px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.sidebar h2 {
    text-align: center;
    font-size: 1.2rem;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    color: white;
}

.sidebar a {
    display: block;
    padding: 14px 25px;
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.2s;
}

.sidebar a:hover, .sidebar a.active {
    background: var(--primary);
    color: #fff;
    border-radius: 0 30px 30px 0;
    margin-right: 15px;
}

/* Layout Content */
.content {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    transition: 0.3s;
}

/* Header Mobile (Top Bar) */
.mobile-header {
    display: none;
    background: #0d0d14;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1002;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

.burger {
    font-size: 28px;
    cursor: pointer;
    color: #fff;
}

/* Card & Form Styling */
.card-table, .card-surat {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card-surat { max-width: 600px; }

/* Input Styling */
label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }

input[type="text"], input[type="password"], select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    background: var(--bg-input);
    border: 1px solid #3f3f5a;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
}

input:focus, textarea:focus { border-color: var(--primary); }

button, .btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    width: 100%;
}

button:hover { background: var(--primary-hover); }

/* Table Styling */
.table-container { overflow-x: auto; width: 100%; margin-top: 20px; }

table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 8px; overflow: hidden; }

th {
    background: rgba(255,255,255,0.05);
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

td { padding: 15px; border-bottom: 1px solid var(--border); color: #eee; }

.btn-delete {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar { left: -100%; }
    .sidebar.show { left: 0; }
    .content { margin-left: 0; padding: 20px; }
    .mobile-header { display: flex; }
    
    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        z-index: 1000;
    }
    .overlay.show { display: block; }

    /* Responsive Table */
    table thead { display: none; }
    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        text-align: right;
        border-bottom: 1px solid var(--border);
    }
    table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--text-muted);
        text-align: left;
    }
}
