/* assets/css/style.css */
:root {
    /* Palet Biru */
    --blue-1:      #2d4aa8;   /* Biru tua — sidebar, header utama */
    --blue-2:      #1a8fd1;   /* Biru sedang — aksen, tombol */
    --blue-3:      #5bb8f5;   /* Biru muda — hover, highlight */
    --blue-4:      #c8e6f9;   /* Biru pucat — background, badge */

    --bg:          #eef5fb;
    --surface:     #ffffff;
    --sidebar-bg:  var(--blue-1);
    --sidebar-hover: #243d8f;
    --accent:      var(--blue-2);
    --accent-dark: #1478b0;
    --text:        #1a2a3a;
    --text-light:  #5a7a96;
    --border:      #c8dff0;
    --danger:      #e03131;
    --success:     #2f9e44;
    --warning:     #e67e22;
    --info:        var(--blue-3);
    --sidebar-w:   260px;
    --radius:      10px;
    --shadow:      0 2px 16px rgba(45,74,168,0.10);
}

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

body{
      font-family: 'DM Sans', sans-serif;
    background: var(--bg) url('../images/img.jpg') center/cover no-repeat;
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    width: 40px; height: 40px;
    background: var(--blue-3);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.brand-sub { font-size: 10px; color: rgba(255,255,255,0.4); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-bottom: 2px;
    transition: all 0.2s;
    font-weight: 400;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--blue-2); color: #fff; font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px; height: 36px;
    background: var(--blue-3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.btn-logout {
    margin-left: auto;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 18px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    display: none;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.topbar-right { margin-left: auto; }
.topbar-user { color: var(--text-light); font-size: 13px; }

.content { padding: 28px; }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
}

.card-body { padding: 24px; }

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.1); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--blue-4); }
.stat-icon.green  { background: #d3f9d8; }
.stat-icon.orange { background: #fff3bf; }
.stat-icon.red    { background: #ffe3e3; }

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== TABLE ===== */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
    background: #eef5fb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0ece3;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f0f7fd; }

/* ===== BADGE / STATUS ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success { background: #d3f9d8; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #ffe3e3; color: #991b1b; }
.badge-info    { background: var(--blue-4); color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }

.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 6px 10px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

label .req { color: var(--danger); }

input[type="text"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--blue-2);
    box-shadow: 0 0 0 3px rgba(26,143,209,0.15);
}

textarea { resize: vertical; min-height: 90px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* ===== ALERT ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
}

.alert button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    color: inherit;
}

.alert-success { background: #d3f9d8; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #ffe3e3; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--blue-4); color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar input {
    width: 260px;
    padding: 8px 14px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pagination a:hover { background: var(--blue-2); color: #fff; border-color: var(--blue-2); }
.pagination span.current { background: var(--blue-2); color: #fff; border-color: var(--blue-2); }
.pagination span.disabled { color: var(--text-light); cursor: default; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-1) 0%, #1a6fb5 60%, var(--blue-3) 100%);
    padding: 20px;
}

.login-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .icon {
    width: 64px; height: 64px;
    background: var(--blue-2);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--text);
}

.login-logo p { color: var(--text-light); font-size: 13px; margin-top: 4px; }

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--blue-2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.2s;
    margin-top: 8px;
}
.login-btn:hover { background: var(--accent-dark); background: #1478b0; }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.detail-item label { color: var(--text-light); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; }
.detail-item .value { font-size: 14px; font-weight: 500; margin-top: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .search-bar input { width: 180px; }
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f7fd;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: #e8f4fc;
}

.upload-area.has-file {
    border-color: var(--success);
    background: #e8f4fc;
}

.upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-text { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-light); }

.upload-filename {
    margin-top: 10px;
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}

/* File existing (saat edit) */
.file-existing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f4fc;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.file-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}
.file-link:hover { text-decoration: underline; }
