/* =============================================
   LPK Mutiara Bunda Siti — Admin Panel CSS
   File: css/style.css
   ============================================= */

/* ===== RESET & VARIABLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --gold:          #C9A84C;
    --gold-light:    #E8C97A;
    --gold-pale:     #FDF6E7;
    --navy:          #0F2044;
    --navy-mid:      #1A3366;
    --navy-soft:     #E8EEF8;
    --white:         #FFFFFF;
    --off-white:     #FAFAF8;
    --text:          #1A1A2E;
    --text-mid:      #4A5568;
    --text-light:    #8892A4;
    --success:       #0F7A4E;
    --success-bg:    #E6F5EF;
    --danger:        #B91C1C;
    --danger-bg:     #FEE2E2;
    --border:        rgba(15, 32, 68, 0.1);
    --radius-sm:     8px;
    --radius-md:     16px;
    --radius-lg:     24px;
    --radius-xl:     40px;
    --shadow-sm:     0 2px 8px rgba(15, 32, 68, 0.06);
    --shadow-md:     0 8px 32px rgba(15, 32, 68, 0.10);
    --shadow-lg:     0 20px 60px rgba(15, 32, 68, 0.15);
    --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--off-white);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ===== UTILITIES ===== */
.hidden    { display: none !important; }
.w-full    { width: 100%; display: block; margin-top: 10px; }

.page { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== TOPBAR ===== */
#topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border, #e5e7eb);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    height: 68px; /* Mengunci tinggi topbar */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%; /* Memastikan area brand mengikuti tinggi topbar */
}

/* Pengatur ukuran gambar logo agar proporsional di dalam topbar */
.logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.topbar-brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--navy, #1e3a8a);
    line-height: 1.2;
}

.topbar-brand-sub {
    font-size: 11px;
    color: var(--text-light, #6b7280);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-mid);
    background: var(--navy-soft);
    padding: 6px 14px;
    border-radius: var(--radius-xl);
}

/* Utility class untuk menyembunyikan elemen sebelum admin login */
.hidden {
    display: none !important;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--gold);
    color: var(--navy);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.4);
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-mid);
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-ghost:hover {
    background: var(--off-white);
    border-color: var(--text-mid);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-danger:hover { background: #991b1b; }

.btn-sm { padding: 7px 16px; font-size: 12px; }

/* ===== LOGIN PAGE ===== */
#page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 5%;
    background: rgba(255, 255, 255, 0.95);
    position: relative;
    overflow: hidden;
}

#page-login::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(circle, var(--gold) 1px, transparent 1px);
    background-size: 40px 40px;
}

#page-login::after {
    content: '';
    position: absolute;
    top: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo {
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 8px;
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

.login-sub {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* ===== FORM FIELDS ===== */
.field-group {
    margin-bottom: 20px;
    text-align: left;
    flex: 1;
}

.field-group.full { flex: 1 1 100%; }

.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--off-white);
    box-shadow: inset 0 1px 2px rgba(15, 32, 68, 0.03);
    transition: var(--transition);
    outline: none;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
    color: var(--text-light);
}

.field-group input:hover,
.field-group select:hover,
.field-group textarea:hover {
    border-color: rgba(15, 32, 68, 0.22);
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--gold);
    background: white;
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.18);
}

.field-group textarea {
    resize: vertical;
    min-height: 90px;
}

/* Select kustom dengan panah emas */
.field-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

/* ===== ADMIN LAYOUT ===== */
.admin-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 5%;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    color: var(--navy);
    letter-spacing: -1px;
    margin-bottom: 6px;
}

.page-title em { color: var(--gold); font-style: italic; }
.page-sub { font-size: 14px; color: var(--text-light); }

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat-chip {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 22px;
    flex: 1;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
}

.stat-chip-val {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.stat-chip-lbl {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    display: block;
}

/* ===== FORM CARD ===== */
.admin-form-card,
.admin-table-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.admin-form-card h3,
.admin-table-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-row .field-group {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    flex-wrap: wrap;
}

/* ===== UPLOAD AREA ===== */
#upload-area,
.upload-area-box {
    border: 2px dashed rgba(15, 32, 68, 0.18);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    background: var(--off-white);
    transition: var(--transition);
}

#upload-area:hover,
.upload-area-box:hover {
    border-color: var(--gold);
    background: var(--gold-pale);
}

.upload-icon { font-size: 28px; margin-bottom: 4px; }
.upload-text { font-size: 13px; color: var(--text-mid); }
.upload-hint { font-size: 11px; color: var(--text-light); margin-top: 2px; }

#upload-status,
.upload-status-text {
    font-size: 12px;
    margin-top: 6px;
    color: var(--text-mid);
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    min-width: 160px;
}

.search-bar input:focus { border-color: var(--navy); }

.search-bar select {
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar select:focus { border-color: var(--navy); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(15, 32, 68, 0.04);
    vertical-align: middle;
}

tbody tr:hover td { background: var(--gold-pale); }

.tbl-btn-edit,
.tbl-btn-del {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: 'DM Sans', sans-serif;
}

.tbl-btn-edit { background: var(--navy-soft); color: var(--navy); margin-right: 6px; }
.tbl-btn-edit:hover { background: var(--navy); color: white; }

.tbl-btn-del { background: var(--danger-bg); color: var(--danger); }
.tbl-btn-del:hover { background: var(--danger); color: white; }

/* ===== BADGES ===== */
.status-badge,
.cert-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge-tersedia { background: var(--success-bg); color: var(--success); }
.badge-bekerja  { background: #fef3c7; color: #92400e; }
.cert-yes       { background: var(--success-bg); color: var(--success); }
.cert-no        { background: var(--danger-bg); color: var(--danger); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }

/* ===== TOAST ===== */
#toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    background: var(--navy);
    color: white;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 340px;
}

#toast.show    { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--success); }
#toast.error   { background: var(--danger); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-topbar    { flex-direction: column; align-items: flex-start; gap: 16px; }
    .form-row        { flex-direction: column; }
    .form-actions    { flex-direction: column; }
    .form-actions button { width: 100%; }
    .login-card      { padding: 36px 24px; }
    .admin-form-card,
    .admin-table-card { padding: 24px; }
    .stats-bar       { gap: 12px; }
    .topbar-brand-sub { display: none; }
    .topbar-inner    { height: 60px; }
}

@media (max-width: 480px) {
    .admin-wrap { padding: 32px 4%; }
}
/* ===== TAB NAVIGASI ADMIN ===== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.admin-tab-btn {
    background: none;
    border: none;
    padding: 14px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    margin-bottom: -1px;
}
.admin-tab-btn:hover { color: var(--navy); }
.admin-tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.admin-tab-content.hidden { display: none; }
