/* ============================
   RESET & BASE
   ============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #1e40af; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================
   LOGIN PAGE
   ============================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 20px;
}

.login-box {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-box h1 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 8px;
    color: #1e40af;
}

.login-box .subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 28px;
}

/* ============================
   FORM ELEMENTS
   ============================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none !important;
}

.btn-primary {
    background: #1e40af;
    color: #fff;
}
.btn-primary:hover { background: #1e3a8a; }

.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }

.btn-block { width: 100%; display: block; }

/* ============================
   ALERTS
   ============================ */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* ============================
   NAVBAR / HEADER
   ============================ */
.navbar {
    background: #1e40af;
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .brand {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.navbar .brand:hover { text-decoration: none; }

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.navbar .user-info .nama {
    font-weight: 600;
}

.navbar .user-info .role {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
}

.navbar .logout-btn {
    color: #fff;
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
}
.navbar .logout-btn:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none;
}

/* ============================
   SIDEBAR & LAYOUT
   ============================ */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar a {
    display: block;
    padding: 11px 20px;
    color: #374151;
    font-size: 14px;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
}

.sidebar a:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.sidebar a.active {
    background: #eff6ff;
    border-left-color: #1e40af;
    color: #1e40af;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    color: #111827;
}

/* ============================
   CARDS
   ============================ */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #1e40af;
}

.stat-card .label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* ============================
   BADGES
   ============================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-success   { background: #dcfce7; color: #166534; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e5e7eb; color: #374151; }

/* ============================
   NOTIFIKASI BELL
   ============================ */
.notif-wrapper {
    position: relative;
    display: inline-block;
}

.notif-bell {
    font-size: 20px;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding: 4px;
    color: #fff;
}

.notif-bell .badge-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    width: 340px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    z-index: 1000;
    color: #1f2937;
}

.notif-header, .notif-footer {
    padding: 10px 14px;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.notif-header { border-bottom: 1px solid #e5e7eb; border-radius: 8px 8px 0 0; }
.notif-footer { border-top: 1px solid #e5e7eb; border-radius: 0 0 8px 8px; text-align: center; }

.notif-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    text-decoration: none;
}
.notif-item:hover { background: #f9fafb; text-decoration: none; }

.notif-item strong { font-size: 13px; }
.notif-item p { font-size: 12px; color: #6b7280; margin: 4px 0; }
.notif-item small { font-size: 11px; color: #9ca3af; }

.notif-sukses     { border-left: 4px solid #22c55e; }
.notif-bahaya     { border-left: 4px solid #ef4444; }
.notif-peringatan { border-left: 4px solid #f59e0b; }
.notif-info       { border-left: 4px solid #3b82f6; }

.notif-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* ============================
   TABLES
   ============================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* ============================
   TABEL - Additional
   ============================ */
.table td small {
    font-size: 12px;
}

.table th:first-child,
.table td:first-child {
    width: 50px;
    text-align: center;
}

.table th:last-child,
.table td:last-child {
    text-align: center;
}

/* Form input focus better */
.form-group input:focus,
.form-group select:focus {
    border-color: #1e40af;
}

/* Tombol kecil */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Statistik 5 kolom untuk halaman pengajuan */
@media (max-width: 900px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Animasi bell saat ada notif baru */
@keyframes shakeBell {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(15deg); }
    50%      { transform: rotate(-15deg); }
    75%      { transform: rotate(10deg); }
}

.notif-bell .badge-count {
    transition: transform 0.2s ease;
}