/* ==========================================================================
   Dashboard Sanksi Karyawan — PT Akui Bird Nest Indonesia
   ========================================================================== */

:root {
  --brown: #4a2e1e;
  --brown-dark: #331f14;
  --gold: #c9a15e;
  --gold-light: #f5ebd8;
  --bg: #f6f4f0;
  --white: #ffffff;
  --text: #2b2118;
  --muted: #7a6e60;
  --border: #e2dbd0;
  --red: #c0392b;
  --green: #2e7d32;
  --shadow: 0 2px 10px rgba(74, 46, 30, 0.08);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Calibri", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--brown) 0%, var(--brown-dark) 55%, #241209 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  padding: 36px 32px;
  text-align: center;
}
.login-card img.logo { height: 64px; margin-bottom: 8px; }
.login-card h1 { font-size: 18px; margin: 8px 0 2px; color: var(--brown); }
.login-card p.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card form { text-align: left; }
.login-card label { font-size: 13px; font-weight: 600; color: var(--brown); display: block; margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.btn-primary {
  width: 100%; margin-top: 22px; padding: 11px; border: none; border-radius: 8px;
  background: var(--brown); color: white; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: var(--brown-dark); }
.form-error { background: #fdecea; color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-top: 16px; display: none; }
.form-success { background: #eaf6ec; color: var(--green); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-top: 16px; display: none; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--brown); color: #f1e9dd;
  display: flex; flex-direction: column; padding: 22px 0;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 16px; }
.sidebar .brand img { height: 34px; }
.sidebar .brand span { font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar nav { flex: 1; }
.sidebar .nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); padding: 14px 20px 6px; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; text-decoration: none;
  color: #eee0cc; border-left: 3px solid transparent; cursor: pointer;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,0.06); }
.sidebar a.nav-link.active { background: rgba(201,161,94,0.18); border-left-color: var(--gold); color: white; font-weight: 600; }
.sidebar .user-box { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 12.5px; }
.sidebar .user-box .u-name { font-weight: 700; font-size: 13.5px; }
.sidebar .user-box .u-role { color: var(--gold); text-transform: capitalize; }
.sidebar .logout-btn { margin-top: 10px; width: 100%; padding: 7px; border: 1px solid rgba(255,255,255,0.25); background: transparent; color: #f1e9dd; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.sidebar .logout-btn:hover { background: rgba(255,255,255,0.1); }

.content { flex: 1; padding: 28px 34px; max-width: 1200px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--brown); margin: 0 0 4px; }
.page-subtitle { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-top: 3px solid var(--gold); }
.stat-card .stat-num { font-size: 28px; font-weight: 700; color: var(--brown); }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.action-card {
  background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  cursor: pointer; border: 1px solid var(--border); transition: transform .12s, box-shadow .12s;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(74,46,30,0.14); }
.action-card h3 { margin: 6px 0 4px; color: var(--brown); font-size: 15.5px; }
.action-card p { margin: 0; font-size: 12.5px; color: var(--muted); }
.action-card .icon { font-size: 26px; }

/* ---------- Generic form (input) ---------- */
.panel { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin-bottom: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.field { margin-bottom: 14px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--brown); margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 13.5px;
  font-family: inherit; background: #fffdfa;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.checkbox-group label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.checkbox-group input[type=checkbox] { width: 16px; height: 16px; }
.section-heading { background: var(--brown); color: white; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 6px; margin: 22px 0 14px; letter-spacing: .03em; }
.section-heading:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.btn { padding: 10px 18px; border-radius: 8px; border: none; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn-gold { background: var(--gold); color: var(--brown-dark); }
.btn-gold:hover { background: #b78f4b; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: #fdecea; color: var(--red); border: 1px solid #f3c8c3; }
.btn-danger:hover { background: #f9d9d5; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th { background: var(--gold-light); color: var(--brown-dark); text-align: left; padding: 9px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data-table tr:hover td { background: #fbf8f3; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-admin { background: var(--gold-light); color: var(--brown); }
.badge-user { background: #eef2f6; color: #46586b; }
.badge-aktif { background: #eaf6ec; color: var(--green); }
.badge-nonaktif { background: #fdecea; color: var(--red); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=text] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; min-width: 220px; }

/* ==========================================================================
   Replika dokumen resmi: Surat Peringatan & Employee Dialog
   ========================================================================== */
.sheet-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.surat-sheet {
  background: white; width: 210mm; min-height: 297mm; margin: 0 auto 30px;
  padding: 14mm 16mm; box-shadow: var(--shadow); font-family: Calibri, "Segoe UI", Arial, sans-serif;
  color: #111; font-size: 12.5px; position: relative;
}
.surat-head-row { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brown); padding-bottom: 8px; }
.surat-head-row img.logo { height: 46px; }
.surat-head-row .doc-code { text-align: right; font-size: 9.5px; line-height: 1.4; color: #444; }
.surat-title { text-align: center; font-weight: 700; font-size: 22px; letter-spacing: .04em; margin: 14px 0 6px; text-transform: uppercase; }
.surat-confidential { text-align: right; color: var(--red); font-weight: 800; font-size: 13px; margin-bottom: 2px; }
.surat-nomor { text-align: right; font-size: 12px; margin-bottom: 10px; }
.surat-kepada { margin: 10px 0 4px; font-size: 13px; }

table.identitas-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
table.identitas-table td { padding: 3px 4px; font-size: 12.5px; vertical-align: top; }
table.identitas-table td.lbl { width: 130px; font-weight: 600; }
table.identitas-table td.colon { width: 14px; }

.surat-body p { text-align: justify; line-height: 1.65; margin: 9px 0; font-size: 12.5px; }
.surat-body .quote { font-style: italic; }
.surat-tanggal-kota { text-align: right; margin-top: 22px; font-size: 12.5px; }

.ttd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 26px; text-align: center; font-size: 12px; }
.ttd-grid .ttd-col .ttd-role { margin-bottom: 58px; }
.ttd-grid .ttd-col .ttd-name { border-top: 1px solid #333; padding-top: 3px; font-weight: 600; min-height: 16px; }
.ttd-grid .ttd-col .ttd-meta { margin-top: 4px; text-align: left; font-size: 11.5px; }

.surat-distribusi { margin-top: 26px; font-size: 11px; }
.surat-distribusi u { text-decoration: underline; }
.surat-distribusi .item { margin-left: 12px; }

.surat-footer-bar { position: absolute; bottom: 10mm; left: 16mm; right: 16mm; display: flex; justify-content: space-between; font-size: 9.5px; color: #555; border-top: 1px solid #ccc; padding-top: 5px; }

/* Employee Dialog specific */
.ed-title-row { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brown); padding-bottom: 8px; }
.ed-title-row .ed-title { font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.ed-title-row .doc-code { text-align: right; font-size: 9.5px; line-height: 1.4; color: #444; }
.ed-nomor { text-align: right; font-size: 12px; margin: 6px 0 12px; }
.ed-section { background: var(--gold-light); color: var(--brown-dark); font-weight: 700; font-size: 12px; padding: 5px 10px; margin: 14px 0 8px; letter-spacing: .03em; }
.ed-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; font-size: 12.5px; }
.ed-grid-2 .ed-row { display: flex; padding: 2px 0; }
.ed-grid-2 .ed-row .ed-lbl { width: 150px; font-weight: 600; }
.ed-grid-2 .ed-row .ed-colon { width: 12px; }
.ed-checklist { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 12.5px; margin: 6px 0; }
.ed-checklist .chk { display: flex; align-items: center; gap: 6px; }
.ed-checklist .box { width: 13px; height: 13px; border: 1.4px solid #333; display: inline-block; text-align: center; line-height: 12px; font-size: 11px; font-weight: 800; }
.ed-textblock { margin: 8px 0; }
.ed-textblock .ed-tb-label { font-weight: 600; font-size: 12px; margin-bottom: 3px; }
.ed-textblock .ed-tb-box { border: 1px solid #999; border-radius: 4px; padding: 8px 10px; min-height: 46px; font-size: 12.3px; white-space: pre-wrap; background: #fdfdfd; }
.ed-sign-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #999; margin-top: 10px; font-size: 11.5px; }
.ed-sign-grid .ed-sign-head { grid-column: span 2; background: var(--gold-light); text-align: center; font-weight: 700; padding: 5px; border: 1px solid #999; }
.ed-sign-grid .ed-sign-col { border: 1px solid #999; padding: 8px 6px; text-align: center; }
.ed-sign-grid .ed-sign-col .role { font-weight: 700; margin-bottom: 48px; }
.ed-sign-grid .ed-sign-col .meta-row { text-align: left; font-size: 11px; margin-top: 3px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .field-grid { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
  .surat-sheet { box-shadow: none; margin: 0; width: auto; min-height: 0; }
  .sheet-toolbar { display: none !important; }
  @page { size: A4; margin: 0; }
}
