/* ============================================================
   HRM - Stylesheet utama
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #0b57d0; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 20px 0; }

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    background: #0b57d0;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar-brand { font-weight: bold; font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.badge-role {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.topbar-link {
    color: white;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
}
.topbar-link:hover { background: rgba(255,255,255,0.15); text-decoration: none; }

.logout-link {
    color: white;
    background: rgba(0,0,0,0.18);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.logout-link:hover { background: rgba(0,0,0,0.32); text-decoration: none; }

/* ============================================================
   LAYOUT (sidebar + content)
   ============================================================ */
.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}
.sidebar {
    width: 240px;
    background: white;
    padding: 18px;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.menu-link {
    display: block;
    padding: 11px 14px;
    margin-bottom: 4px;
    background: transparent;
    border-radius: 8px;
    color: #444;
    font-weight: 500;
    transition: background 0.15s;
}
.menu-link:hover { background: #f5f7fa; text-decoration: none; }
.menu-link.active {
    background: #dbe8ff;
    color: #0b57d0;
    font-weight: bold;
}

.content {
    flex: 1;
    padding: 24px;
    min-width: 0; /* supaya table lebar tidak break layout */
}

/* ============================================================
   SECTION & CARD
   ============================================================ */
.section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-label {
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.card-value {
    font-size: 24px;
    font-weight: bold;
    margin-top: 6px;
    color: #0b57d0;
}

/* ============================================================
   FORM
   ============================================================ */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
    font-size: 13px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) {
    .row { grid-template-columns: 1fr; }
}

small {
    display: block;
    margin-top: -8px;
    margin-bottom: 12px;
    font-size: 12px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid #0b57d0;
    outline-offset: -1px;
    border-color: transparent;
}

button, .btn {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}
button:hover, .btn:hover { opacity: 0.9; text-decoration: none; }

.btn-primary { background: #0b57d0; color: white; }
.btn-block   { display: block; width: 100%; }
.btn-gray    { background: #6b7280; color: white; }
.btn-red     { background: #c62828; color: white; }
.btn-green   { background: #15803d; color: white; }
.btn-small   { padding: 7px 12px; font-size: 13px; }

/* Input + tombol sebaris (mis. "Tambah Jabatan baru ...  [+ Tambah]") */
.field-with-btn {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: stretch;
}
.field-with-btn input,
.field-with-btn select,
.field-with-btn textarea {
    flex: 1;
    margin-bottom: 0;
}
.field-with-btn button,
.field-with-btn .btn {
    margin-bottom: 0;
    white-space: nowrap;
}

/* ============================================================
   TABLE
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
th, td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}
th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
}

/* ============================================================
   BADGE (status warna)
   ============================================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}
.green  { background: #d1fae5; color: #065f46; }
.blue   { background: #dbeafe; color: #1d4ed8; }
.yellow { background: #fef3c7; color: #92400e; }
.red    { background: #fee2e2; color: #991b1b; }
.gray   { background: #e5e7eb; color: #374151; }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
.alert-success {
    background: #e7f6ec;
    color: #19692c;
    border-left: 4px solid #15803d;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #c62828;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, #0b57d0, #1d4ed8);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: white;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-box h1 {
    text-align: center;
    color: #0b57d0;
    margin: 0 0 4px;
    font-size: 28px;
}
.login-box .subtitle {
    text-align: center;
    color: #6b7280;
    margin: 0 0 24px;
    font-size: 13px;
}

/* ============================================================
   INSTALL PAGE
   ============================================================ */
.install-page {
    background: #f4f6f8;
    padding: 40px 20px;
    min-height: 100vh;
}
.install-box {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.install-box h1 { color: #0b57d0; margin-top: 0; }

/* ============================================================
   MODAL (untuk tahap berikutnya)
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}
.modal-box {
    background: white;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    padding: 24px;
    border-radius: 14px;
}
