/* =====================================================================
   INTRANET DIGITAL ILKKM SANDAKAN
   Government Clean White + Corporate · Mobile First Responsive
   ===================================================================== */
:root {
  --navy: #123f68;
  --navy-2: #0b3153;
  /* --accent-base & --accent-dark diambil daripada atribut style inline
     (warna pilihan pengguna). --accent/--accent-2 dikira daripadanya. */
  --accent-base: #123f68;
  --accent-dark: #123f68;
  --accent: var(--accent-base);
  --accent-2: var(--accent-dark);
  --blue: #2b78b5;
  --blue-soft: #e8f3fb;
  --ink: #152536;
  --muted: #718096;
  --muted-2: #96a3b0;
  --line: #e7edf3;
  --bg: #f5f8fb;
  --white: #fff;
  --surface: #fff;
  --surface-2: #f6f8fb;
  --green: #138a72;
  --orange: #d97706;
  --purple: #7856b8;
  --red: #bd4b55;
  --radius: 10px;
  --shadow: 0 1px 2px #123f680d, 0 8px 24px #123f680a;
  --shadow-lg: 0 18px 60px #123f681c;
  --font-scale: 1;
}

/* Aksen dinamik — sidebar & elemen utama mengikut pilihan warna pengguna */
[data-theme] .sidebar { background: linear-gradient(180deg, var(--accent-2), var(--accent) 60%); }

/* Saiz font boleh laras pengguna */
[data-font="small"]  { --font-scale: 0.92; }
[data-font="normal"] { --font-scale: 1; }
[data-font="large"]  { --font-scale: 1.12; }
html { font-size: calc(16px * var(--font-scale)); }

/* Mod gelap */
[data-theme="dark"] {
  --navy: #0b3153;
  --navy-2: #071f36;
  --ink: #e6edf5;
  --muted: #9fb0c2;
  --muted-2: #7d8ea0;
  --line: #21344a;
  --bg: #0d1725;
  --white: #16273b;
  --surface: #16273b;
  --surface-2: #1c2f46;
  --blue-soft: #1d3a57;
  --shadow: 0 1px 2px #00000040, 0 8px 24px #00000033;
  --shadow-lg: 0 18px 60px #00000059;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .topbar,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card-item,
[data-theme="dark"] .profile-head,
[data-theme="dark"] .auth-card.narrow,
[data-theme="dark"] .search-results { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .search { background: var(--surface-2); border-color: var(--line); }
[data-theme="dark"] .search input { color: var(--ink); }
[data-theme="dark"] table thead th { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] th, [data-theme="dark"] td { border-color: var(--line); }
[data-theme="dark"] .mobile-nav { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .mobile-nav a { color: #9fb0c2; }
[data-theme="dark"] .mobile-nav a.active { color: var(--accent); }
[data-theme="dark"] code { background: #0b1a2b; color: #cfe0ef; }
[data-theme="dark"] .form-grid input,
[data-theme="dark"] .form-grid select,
[data-theme="dark"] .form-grid textarea,
[data-theme="dark"] .filter-bar input,
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .stack input,
[data-theme="dark"] .stack select,
[data-theme="dark"] .stack textarea,
[data-theme="dark"] label input,
[data-theme="dark"] label select,
[data-theme="dark"] label textarea {
  background: #0f2033; color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] label { color: #9fb0c2; }
[data-theme="dark"] .avatar { background: #1c2f46; color: #cfe6fb; border-color: var(--line); }
[data-theme="dark"] .avatar.xlarge { background: var(--accent); color: #fff; }
[data-theme="dark"] .pill.ok, [data-theme="dark"] .alert-success { background: #10352c; color: #6fdcbf; }
[data-theme="dark"] .pill.info, [data-theme="dark"] .alert-info { background: #17364f; color: #8fc4ea; }
[data-theme="dark"] .pill.warn, [data-theme="dark"] .alert-warning { background: #3a2f14; color: #f0cc7a; }
[data-theme="dark"] .pill.bad, [data-theme="dark"] .alert-danger { background: #3a1d24; color: #f0a3ab; }
[data-theme="dark"] .pill.muted { background: #24384f; color: #a9b8c7; }
[data-theme="dark"] .tag { background: #17364f; color: #8fc4ea; }
[data-theme="dark"] .stat-icon.blue { background: #17364f; }
[data-theme="dark"] .stat-icon.orange { background: #3a2f14; }
[data-theme="dark"] .stat-icon.purple { background: #2b2340; }
[data-theme="dark"] .stat-icon.green { background: #10352c; }
[data-theme="dark"] .import-help,
[data-theme="dark"] .perm-editor,
[data-theme="dark"] .perm-toggle-row { background: var(--surface-2); border-color: var(--line); }
[data-theme="dark"] .perm-item { background: #16273b; border-color: var(--line); }
[data-theme="dark"] .alert { color: var(--ink); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -0.3px; }
a { color: inherit; }
code { font-family: "SF Mono", Consolas, monospace; font-size: 12px; background: #eef3f8; padding: 2px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.center { text-align: center; }
.inline { display: inline; }
.wrap { word-break: break-all; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-one { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- Layout utama ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.main-area { margin-left: 258px; min-width: 0; flex: 1; display: flex; flex-direction: column; }

.content { padding: 34px 40px; max-width: 1620px; width: 100%; margin: 0 auto; flex: 1; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 258px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy) 60%);
  color: #dbeafa;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  padding: 24px 14px 16px;
  overflow-y: auto;
}

.brand { display: flex; gap: 11px; align-items: center; }
.brand-mark {
  height: 40px; width: 40px; flex: none;
  background: #fff; color: var(--navy);
  border-radius: 11px; display: grid; place-items: center;
  font: 800 22px "Plus Jakarta Sans", sans-serif;
}
.brand-mark img { width: 30px; height: 30px; object-fit: contain; display: block; }
.brand strong { display: block; color: #fff; font: 800 19px "Plus Jakarta Sans"; letter-spacing: 1px; }
.brand span { font-size: 7.5px; letter-spacing: 1.5px; opacity: 0.72; }
.sidebar .brand { padding: 2px 10px 26px; }

.nav-label { color: #83a5c4; font-size: 9.5px; font-weight: 700; letter-spacing: 1.5px; padding: 15px 12px 7px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #bbd0e2;
  padding: 11px 12px; border-radius: 8px;
  font-weight: 500; font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a span { width: 18px; text-align: center; font-size: 17px; opacity: 0.85; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.sidebar nav a.active { box-shadow: inset 3px 0 #f0a44b; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 12px; display: grid; gap: 2px; }
.sidebar-bottom a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #bbd0e2; padding: 11px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.sidebar-bottom a span { width: 18px; text-align: center; font-size: 16px; }
.sidebar-bottom a:hover, .sidebar-bottom a.active { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------------- Topbar ---------------- */
.topbar {
  height: 74px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; position: sticky; top: 0; z-index: 20; gap: 20px;
}
.menu-toggle { display: none; border: 0; background: none; font-size: 22px; color: var(--navy); cursor: pointer; padding: 4px; }

.search {
  display: flex; align-items: center; gap: 11px;
  background: #f6f8fb; border: 1px solid #edf1f5; border-radius: 7px;
  width: 340px; padding: 10px 13px; color: #98a8b8; position: relative;
}
.search input { border: 0; background: transparent; outline: none; width: 100%; font: inherit; color: var(--ink); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 380px; overflow-y: auto; z-index: 40; padding: 6px;
}
.search-result-item { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; }
.search-result-item:hover { background: var(--blue-soft); }
.search-result-item strong { display: block; font-size: 12.5px; }
.search-result-item small { color: var(--muted-2); font-size: 10.5px; }
.search-loading, .search-empty { padding: 14px; color: var(--muted); font-size: 12px; text-align: center; }

.top-actions { display: flex; align-items: center; gap: 24px; }
.icon-btn { border: 0; background: none; font-size: 22px; color: #627487; position: relative; cursor: pointer; text-decoration: none; }
.icon-btn i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #e16b68; right: 2px; top: 2px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-text strong, .user-text small { display: block; }
.user-text strong { font-size: 12.5px; }
.user-text small { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* Menu pengguna (kanan atas) */
.user-menu { position: relative; }
.user-chip {
  border: 0; background: none; padding: 4px 6px; border-radius: 9px;
  cursor: pointer; font: inherit; color: inherit; text-align: left;
}
.user-chip:hover { background: var(--blue-soft); }
.user-caret { font-size: 10px; color: var(--muted); margin-left: 2px; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 50;
  min-width: 244px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow-lg); padding: 6px; overflow: hidden;
}
.user-dropdown-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.user-dropdown-head > div { min-width: 0; }
.user-dropdown-head strong { display: block; font-size: 12.5px; }
.user-dropdown-head small { color: var(--muted); font-size: 10.5px; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: 7px; text-decoration: none;
  color: var(--ink); font-size: 12.5px; font-weight: 500;
}
.user-dropdown-item > span {
  width: 20px; text-align: center; font-size: 15px; opacity: 0.8; flex: none;
}
.user-dropdown-item:hover { background: var(--blue-soft); }
.user-dropdown-item.danger { color: var(--red); font-weight: 700; }
.user-dropdown-item.danger:hover { background: #fdebed; }
.user-dropdown-item .badge {
  margin-left: auto; background: var(--red); color: #fff; font-style: normal;
  font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
}
.user-dropdown-sep { height: 1px; background: var(--line); margin: 6px 4px; }
[data-theme="dark"] .user-chip:hover { background: #17364f; }
[data-theme="dark"] .user-dropdown-item:hover { background: #17364f; }
[data-theme="dark"] .user-dropdown-item.danger:hover { background: #3a1d24; }

.avatar {
  width: 37px; height: 37px; border-radius: 50%;
  background: var(--blue-soft); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none;
}
.avatar.small { width: 35px; height: 35px; background: #eaf5f1; color: var(--green); }
.avatar.large { width: 58px; height: 58px; font-size: 18px; margin: 0 auto; }
.avatar.xlarge { width: 84px; height: 84px; font-size: 26px; background: var(--navy); color: #fff; }
.avatar.has-image { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------- Page heading ---------------- */
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: #73879b; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; margin-bottom: 7px; }
.page-heading h1 { margin: 0; font: 700 25px "Plus Jakarta Sans"; letter-spacing: -0.5px; }
.page-heading h1 em { color: var(--accent); font-style: normal; }
/* Dalam mod gelap, aksen gelap terlalu samar — cerahkan supaya kekal terbaca. */
[data-theme="dark"] .page-heading h1 em { color: color-mix(in srgb, var(--accent) 35%, #cfe6fb); }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------- Butang ---------------- */
.btn {
  border: 0; border-radius: 7px; padding: 11px 16px;
  font-weight: 700; font-family: inherit; font-size: 12.5px;
  cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
  transition: filter 0.15s, background 0.15s; white-space: nowrap;
}
.btn:hover { filter: brightness(0.96); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 11px #123f6833; }
.btn-secondary { background: var(--blue-soft); color: var(--accent); }
.btn-ghost { background: #f2f5f8; color: #5c6d7d; }
.btn-danger { background: #fdebed; color: #a23845; }
.btn-light { background: #fff; color: var(--accent); }
.btn-sm { padding: 7px 11px; font-size: 11px; border-radius: 6px; }
[data-theme="dark"] .btn-secondary { background: #1d3a57; color: #cfe6fb; }
[data-theme="dark"] .btn-ghost { background: #1c2f46; color: #b8c6d4; }
[data-theme="dark"] .btn-danger { background: #3a1d24; color: #f0a3ab; }
[data-theme="dark"] .btn-light { background: #1c2f46; color: #cfe6fb; }
.full { width: 100%; }

/* ---------------- Alert ---------------- */
.alert { padding: 13px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; }
.alert-success { background: #e8f6f1; color: #16745f; }
.alert-danger { background: #fdebed; color: #a23845; }
.alert-warning { background: #fff4d7; color: #795c16; }
.alert-info { background: var(--blue-soft); color: var(--navy); }

/* ---------------- Stat cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 13px;
  position: relative; box-shadow: var(--shadow);
}
.stat-icon { width: 41px; height: 41px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; flex: none; }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.orange { color: var(--orange); background: #fff4e4; }
.stat-icon.purple { color: var(--purple); background: #f0ebfa; }
.stat-icon.green { color: var(--green); background: #e9f6f2; }
.stat-card strong { font-size: 23px; display: block; font-family: "Plus Jakarta Sans"; line-height: 1.1; }
.stat-card span { display: block; font-size: 11.5px; font-weight: 600; margin-top: 1px; }
.stat-card small { display: block; color: var(--muted-2); font-size: 10px; margin-top: 4px; }
.stat-arrow { position: absolute; right: 16px; top: 16px; color: #b8c3cc; font-size: 13px; }

/* ---------------- Panel ---------------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel h2 { font: 700 15px "Plus Jakarta Sans"; margin: 0 0 4px; }
.panel-head p { color: #8a98a6; font-size: 11px; margin: 0; }
.panel-head a { font-size: 11px; color: var(--blue); text-decoration: none; font-weight: 700; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: 1.18fr 0.82fr; gap: 19px; margin-bottom: 20px; }
.lower-grid { grid-template-columns: 1fr 1fr; }
.detail-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 19px; margin-bottom: 20px; }

/* ---------------- Senarai pengumuman / aktiviti ---------------- */
.announcement-item { display: flex; padding: 14px 0; border-bottom: 1px solid #edf1f4; gap: 13px; }
.announcement-item:last-child { border-bottom: 0; padding-bottom: 0; }
.announcement-badge { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 11px; }
.announcement-badge.pinned { background: #fff4e4; color: var(--orange); }
.announcement-body { flex: 1; min-width: 0; }
.announcement-body h3 { font-size: 12.5px; margin: 6px 0 8px; }
.item-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.item-meta time { color: #99a5b0; font-size: 10px; }
.item-actions { display: flex; justify-content: space-between; gap: 12px; color: #a0aab4; font-size: 10px; }
.item-actions .clamp-one { max-width: 62%; text-align: right; }
.tag { color: var(--blue); background: #eef6fc; border-radius: 4px; padding: 3px 7px; font-size: 9.5px; font-weight: 700; display: inline-block; }

.event-item { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid #edf1f4; }
.event-item:last-child { border-bottom: 0; }
.event-item h3 { font-size: 12.5px; margin: 1px 0 6px; }
.event-item p { color: #8593a0; font-size: 10.5px; margin: 0 0 5px; }
.event-item small { color: var(--muted-2); font-size: 10px; }
.date-box { width: 45px; height: 45px; flex: none; border-radius: 7px; background: #f0f5f9; display: grid; place-content: center; text-align: center; }
.date-box strong { font-size: 16px; color: var(--navy); line-height: 1; }
.date-box span { font-size: 8px; color: #76899c; font-weight: 700; }
.date-box.small { width: 40px; height: 40px; }
.date-box.small strong { font-size: 14px; }

.absence-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf1f4; }
.absence-row:last-child { border-bottom: 0; }
.absence-row strong { font-size: 12px; display: block; }
.absence-row small { color: #8695a3; font-size: 10.5px; display: block; margin-top: 3px; }
.absence-row > div:not(.date-box):not(.avatar) { flex: 1; min-width: 0; }
.status-dot { color: #e1a33f; font-size: 14px; margin-left: auto; }

.highlight-panel { background: linear-gradient(135deg, var(--navy), #24638f); color: #fff; border: 0; position: relative; overflow: hidden; }
.highlight-panel::after { content: ""; position: absolute; width: 180px; height: 180px; border: 35px solid #ffffff14; border-radius: 50%; right: -70px; bottom: -80px; }
.highlight-panel .eyebrow { color: #b5d2ea; }
.highlight-panel h2 { font-size: 19px; max-width: 290px; line-height: 1.35; margin: 8px 0; color: #fff; }
.highlight-panel p { color: #c3d8e9; font-size: 12px; max-width: 330px; line-height: 1.6; }
.highlight-icon { font-size: 27px; color: #8fc1e4; }

/* ---------------- Pill / status ---------------- */
.pill { display: inline-block; border-radius: 20px; padding: 4px 10px; font-size: 10px; font-weight: 700; }
.pill.ok { background: #e8f6f1; color: #16745f; }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.warn { background: #fff4e4; color: #96610a; }
.pill.bad { background: #fdebed; color: #a23845; }
.pill.muted { background: #eef1f4; color: #64717d; }

/* ---------------- Borang ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; align-items: end; }
.span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; color: #5c6d7d; font-size: 11px; font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid #dfe7ee; border-radius: 6px;
  background: #fbfcfd; color: var(--ink); padding: 10px 12px;
  font: inherit; font-weight: 400; outline: none; transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #2b78b51c; }
textarea { min-height: 84px; resize: vertical; }
input[type="file"] { padding: 8px; background: #fff; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar input[type="search"], .filter-bar input[type="text"] { flex: 1; min-width: 200px; }
.filter-bar select { max-width: 240px; }

.segmented { display: inline-flex; background: #eef2f6; border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented.wide { display: flex; margin-bottom: 18px; }
.segmented a { padding: 8px 15px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #5f7080; text-decoration: none; }
.segmented a.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px #123f681f; }

/* ---------------- Jadual ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #81909e; font-size: 9.5px; letter-spacing: 0.5px; text-transform: uppercase; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 10px; border-bottom: 1px solid #edf1f4; color: #607181; font-size: 12px; vertical-align: top; }
td strong { display: block; color: var(--ink); font-size: 12px; margin-bottom: 3px; }
td small { display: block; color: #8795a2; font-size: 10.5px; max-width: 340px; }
.table-link { color: var(--blue); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------------- Kad ---------------- */
.card-list { display: grid; gap: 13px; }
.card-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; background: #fff; transition: transform 0.15s, box-shadow 0.15s; }
.card-item:hover { box-shadow: var(--shadow); }
.card-item.pinned { border-left: 3px solid var(--orange); }
.card-item.unread { border-left: 3px solid var(--blue); background: #fdfefe; }
.card-item.read { opacity: 0.82; }
.card-item h3 { font-size: 14.5px; margin: 9px 0 7px; }
.card-item p { color: #617182; font-size: 12.5px; margin: 0 0 10px; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.card-foot { display: flex; justify-content: space-between; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.empty-state { text-align: center; color: #8b99a5; padding: 38px 16px; font-size: 13px; }

/* ---------------- Kalendar ---------------- */
.calendar-toolbar { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.calendar-nav { display: flex; align-items: center; gap: 11px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-head { background: #f4f7fa; padding: 10px 6px; text-align: center; font-size: 10.5px; font-weight: 700; color: #6f8091; }
.cal-cell { background: #fff; min-height: 96px; padding: 8px; }
.cal-cell.empty { background: #fafcfd; }
.cal-cell.today { background: #f3f9fe; box-shadow: inset 0 0 0 1.5px var(--blue); }
.cal-day { font-size: 11.5px; font-weight: 700; color: #62748a; margin-bottom: 5px; }
.cal-event { font-size: 10px; padding: 4px 6px; border-radius: 4px; margin-bottom: 3px; background: color-mix(in srgb, var(--ev-color) 12%, #fff); border-left: 3px solid var(--ev-color); color: #3c4d5e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event small { display: block; font-size: 8.5px; color: #7d8c9c; }

/* ---------------- Profil, direktori, pautan ---------------- */
.profile-head { display: flex; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.profile-head h2 { margin: 0 0 4px; font-size: 19px; }
.profile-head .card-meta { margin-top: 9px; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.person-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.person-card strong { display: block; font-size: 13px; margin: 11px 0 3px; }
.person-card .tag { margin-top: 9px; }
.person-contact { margin-top: 11px; display: grid; gap: 4px; font-size: 11px; }
.person-contact a { color: var(--blue); text-decoration: none; }
.person-contact span { color: var(--muted); }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.link-card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; text-decoration: none; transition: border 0.15s, box-shadow 0.15s; }
.link-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.link-icon { font-size: 17px; color: var(--blue); display: block; margin-bottom: 9px; }
.link-card strong { display: block; font-size: 13px; margin-bottom: 5px; }
.link-card small { color: var(--muted); font-size: 11px; }

.result-item { display: block; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.result-item:hover { background: var(--blue-soft); }
.result-item strong { display: block; font-size: 13px; margin-bottom: 3px; }
.result-item small { color: var(--muted); font-size: 11px; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 11px; margin-top: 6px; }
.perm-item { flex-direction: row; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; cursor: pointer; }
.perm-item:hover { border-color: var(--blue); background: var(--blue-soft); }
.perm-item input { width: auto; margin-top: 2px; flex: none; }
.perm-item span { display: grid; gap: 3px; }
.perm-item strong { font-size: 12.5px; color: var(--ink); }
.perm-item small { color: var(--muted-2); font-size: 10px; font-family: "SF Mono", Consolas, monospace; }

/* Import pengguna (CSV) */
.import-help { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 9px; background: var(--surface-2); }
.import-help strong { font-size: 12.5px; }
.import-help ul { margin: 9px 0 8px; padding-left: 20px; display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.import-help code { font-size: 11px; }

/* Editor kebenaran khusus per staf */
.staff-picker { margin-bottom: 16px; }
.perm-editor { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: var(--surface-2); margin-top: 8px; }
.perm-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.perm-editor-head h3 { margin: 3px 0 2px; font-size: 16px; }
.perm-editor-head p { margin: 0; }
.perm-toggle-list { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 8px; }
.perm-toggle-list > strong { letter-spacing: 1px; }
.perm-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.perm-toggle-row.on { border-left: 3px solid var(--green); }
.perm-toggle-row.off { border-left: 3px solid var(--muted-2); opacity: 0.85; }
.perm-toggle-row span { font-size: 12.5px; }

/* ---------------- Detail & agenda ---------------- */
.detail-list { display: grid; gap: 0; margin: 0 0 16px; }
.detail-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.detail-list dt { color: var(--muted); font-size: 11.5px; }
.detail-list dd { margin: 0; font-size: 12.5px; font-weight: 600; text-align: right; }

.agenda-list { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.agenda-list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 11px 13px; background: #f8fafc; border-radius: 8px; font-size: 12.5px; }
.agenda-list strong { display: block; }
.agenda-list small { color: var(--muted); font-size: 11px; }

/* ---------------- Ketersediaan & QR ---------------- */
.availability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 13px; }
.availability-card { border: 1px solid var(--line); border-radius: 8px; padding: 15px; display: grid; gap: 6px; }
.availability-card strong { font-size: 13px; }
.availability-card small { color: var(--muted); font-size: 11px; }

.qr-share, .qr-preview { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr-image { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; }
.qr-frame { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; place-items: center; }
.qr-frame .qr-image { border: 0; padding: 0; }
.qr-share-body { flex: 1; min-width: 240px; display: grid; gap: 12px; }

/* Zon tindakan sensitif (jana semula QR, tukar password) */
.danger-zone { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; display: grid; gap: 14px; }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.danger-row > div { min-width: 220px; flex: 1; }
.danger-row strong { display: block; font-size: 13px; }
.danger-row p { margin: 3px 0 0; }
.form-inline-narrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-inline-narrow input { max-width: 220px; }

/* Toggle tema di topbar */
.theme-toggle { cursor: pointer; font-size: 17px; background: none; border: 0; color: var(--ink); }
.theme-toggle:hover { color: var(--accent); }

/* Menu kongsi sejagat (fallback desktop bagi Web Share API) */
.share-menu {
  position: fixed; z-index: 60; min-width: 208px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px;
}
.share-menu-head {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted-2); padding: 7px 10px 5px;
}
.share-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--ink); font: inherit; font-size: 12.5px; text-align: left;
  text-decoration: none; cursor: pointer;
}
.share-menu-item:hover { background: var(--blue-soft); }
.share-menu-item > span {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 6px; background: var(--surface-2); font-size: 12px; font-weight: 700;
}
.share-menu-copy { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
[data-theme="dark"] .share-menu-item:hover { background: #17364f; }
[data-theme="dark"] .share-menu-item > span { background: #0f2033; }

/* ---------------- Editor Kandungan Kaya ---------------- */
.rt-wrap { display: block; }
.rt-label { display: flex; flex-direction: column; gap: 3px; margin-bottom: 7px; }
.rt-label > span { font-size: 11px; font-weight: 700; color: #5c6d7d; }
[data-theme="dark"] .rt-label > span { color: #9fb0c2; }
.rt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
  padding: 7px 8px; background: var(--surface-2);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.rt-btn {
  min-width: 30px; height: 30px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer;
}
.rt-btn:hover { background: var(--blue-soft); border-color: var(--line); }
.rt-btn.active { background: var(--accent); color: #fff; }
.rt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rt-select {
  height: 30px; padding: 0 6px; font-size: 12px; width: auto;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.rt-color {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0;
}
.rt-editor {
  min-height: 260px; max-height: 620px; overflow-y: auto;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  color: var(--ink); font-size: 14px; line-height: 1.75; outline: none;
}
.rt-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.rt-editor:empty::before {
  content: attr(data-placeholder); color: var(--muted-2); pointer-events: none;
}
.rt-editor h1 { font-size: 24px; margin: 14px 0 8px; }
.rt-editor h2 { font-size: 20px; margin: 13px 0 7px; }
.rt-editor h3 { font-size: 17px; margin: 12px 0 6px; }
.rt-editor h4 { font-size: 15px; margin: 11px 0 6px; }
.rt-editor p { margin: 8px 0; }
.rt-editor ul, .rt-editor ol { margin: 8px 0; padding-left: 26px; }
.rt-editor blockquote {
  margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: var(--surface-2); color: var(--muted); border-radius: 0 6px 6px 0;
}
.rt-editor pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; overflow-x: auto; font-family: "SF Mono", Consolas, monospace; font-size: 12.5px;
}
.rt-editor code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.rt-editor a { color: var(--blue); text-decoration: underline; }
.rt-editor table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.rt-editor th, .rt-editor td { border: 1px solid var(--line); padding: 7px 9px; vertical-align: top; }
.rt-editor th { background: var(--surface-2); font-weight: 700; text-align: left; }
.rt-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.rt-editor hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
[data-theme="dark"] .rt-toolbar { background: #0f2033; }
[data-theme="dark"] .rt-editor { background: #0f2033; }
[data-theme="dark"] .rt-editor th { background: #16273b; }
[data-theme="dark"] .rt-btn:hover { background: #17364f; }
[data-theme="dark"] .rt-select { background: #16273b; }
.rt-source { font-family: "SF Mono", Consolas, monospace; font-size: 12.5px; }

/* Kandungan kaya yang dipaparkan (halaman awam & pratonton) */
.rich-content { font-size: 15px; line-height: 1.85; color: var(--ink); }
.rich-content h1, .rich-content h2, .rich-content h3 { color: var(--accent); margin: 18px 0 9px; }
.rich-content h1 { font-size: 24px; } .rich-content h2 { font-size: 20px; } .rich-content h3 { font-size: 17px; }
.rich-content p { margin: 9px 0; }
.rich-content ul, .rich-content ol { margin: 9px 0; padding-left: 26px; }
.rich-content blockquote { margin: 12px 0; padding: 9px 15px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; }
.rich-content table { border-collapse: collapse; width: 100%; margin: 14px 0; overflow-x: auto; display: block; }
.rich-content th, .rich-content td { border: 1px solid var(--line); padding: 9px 11px; vertical-align: top; }
.rich-content th { background: var(--surface-2); font-weight: 700; text-align: left; }
.rich-content a { color: var(--blue); text-decoration: underline; }
.rich-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.rich-content pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; overflow-x: auto; }
.rich-content hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[data-theme="dark"] .rich-content th { background: #16273b; }

/* ---------------- Admin: Unit/Jawatan & Hierarki Direktori ---------------- */
.admin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1120px) { .admin-split { grid-template-columns: 1fr; } }

.dir-order-cell { position: relative; white-space: nowrap; }
.dir-pos {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.dir-move { display: inline-flex; flex-direction: column; gap: 1px; margin-left: 5px; vertical-align: middle; }
.dir-move button {
  width: 20px; height: 13px; padding: 0; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); border-radius: 3px;
  font-size: 7px; line-height: 1; cursor: pointer;
}
.dir-move button:hover:not(:disabled) { background: var(--blue-soft); color: var(--accent); }
.dir-move button:disabled { opacity: 0.3; cursor: not-allowed; }
.dir-grip { cursor: grab; color: var(--muted-2); margin-left: 6px; font-size: 15px; vertical-align: middle; }
#dirBody tr { cursor: default; }
#dirBody tr.dragging { opacity: 0.45; background: var(--blue-soft); }
#dirBody tr:hover { background: var(--surface-2); }
[data-theme="dark"] .dir-move button { background: #16273b; }

/* Direktori staf — jadual hierarki */
.directory-table td { vertical-align: middle; }
.dir-person { display: flex; align-items: center; gap: 10px; }
.dir-person .avatar { width: 34px; height: 34px; font-size: 12px; flex: none; }
.dir-contact { display: grid; gap: 2px; font-size: 11.5px; }
.dir-contact a { color: var(--blue); text-decoration: none; }
.dir-contact span { color: var(--muted); }

/* Semua peranti: paparkan butang dipilih dengan jelas dalam toolbar editor */
@media print {
  .rt-toolbar, .dir-move, .dir-grip { display: none !important; }
  .rt-editor { border: 0; padding: 0; max-height: none; overflow: visible; }
}
.qr-preview { flex-direction: column; align-items: center; margin-top: 16px; }

.window-status { background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 15px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.window-status.aktif { background: #effaf6; border-color: #c9e9df; }
.window-status.akan { background: #fff9ec; border-color: #f2e2bd; }
.window-status.tamat { background: #fdf0f1; border-color: #f2ccd1; }
.window-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.window-info > div { display: grid; gap: 3px; }
.window-info strong { font-size: 13px; color: var(--ink); }
.window-arrow { color: var(--muted-2); font-size: 17px; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 11px; }
.image-grid figure { margin: 0; position: relative; }
.image-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.image-grid form { position: absolute; top: 6px; right: 6px; }

.success-mark { width: 62px; height: 62px; border-radius: 50%; background: #e8f6f1; color: var(--green); display: grid; place-items: center; font-size: 32px; font-weight: 700; margin: 6px auto 18px; }

/* ---------------- Halaman auth / log masuk korporat ---------------- */
.auth-page { min-height: 100vh; background: linear-gradient(160deg, #eef3f8, #f7fafc 55%, #eaf0f6); display: grid; place-items: center; padding: 28px 20px; }
.auth-page.centered { background: linear-gradient(135deg, #eef5fa, #f7fafc); }
.auth-wrap { display: grid; grid-template-columns: 1.02fr 0.98fr; width: min(1060px, 100%); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 70px #123f6826, 0 2px 6px #123f6812; border: 1px solid #dfe8f0; }

/* Panel korporat (kiri) */
.auth-aside { position: relative; background: linear-gradient(165deg, #0b3153, var(--navy) 58%, #1a5480); color: #d7e7f5; padding: 40px 40px 30px; display: flex; flex-direction: column; gap: 24px; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 86% 6%, #ffffff21, transparent 46%), linear-gradient(0deg, #04182b7a, transparent 58%); pointer-events: none; }
.auth-aside::before { content: ""; position: absolute; right: -64px; bottom: 34px; width: 330px; height: 330px; background: url("img/jata-negara.png") center/contain no-repeat; opacity: 0.09; pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }

.corp-top { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid #ffffff26; }
.corp-jata { width: 46px; height: auto; flex: none; filter: drop-shadow(0 3px 8px #00000045); }
.corp-min strong { display: block; font: 700 12.5px "Plus Jakarta Sans", sans-serif; letter-spacing: 0.4px; color: #fff; line-height: 1.35; }
.corp-min span { font-size: 9px; letter-spacing: 1.4px; color: #9fc0dc; text-transform: uppercase; }

.corp-photo { border-radius: 10px; overflow: hidden; border: 1px solid #ffffff2e; box-shadow: 0 16px 40px #04182b66; }
.corp-photo img { display: block; width: 100%; height: 205px; object-fit: cover; }

.corp-inst { display: grid; gap: 12px; }
.corp-kicker { display: inline-block; justify-self: start; font: 700 10px "Plus Jakarta Sans", sans-serif; letter-spacing: 2.4px; color: #f3cd7a; border: 1px solid #f3cd7a5c; border-radius: 999px; padding: 5px 13px; }
.corp-inst h2 { color: #fff; font: 800 20px/1.42 "Plus Jakarta Sans", sans-serif; margin: 0; letter-spacing: 0.2px; }
.corp-rule { width: 54px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #f0c14b, #d9a12f); }
.corp-inst p { font-size: 12px; line-height: 1.72; color: #b7d0e5; margin: 0; }

.auth-foot { margin-top: auto; font-size: 10px; line-height: 1.6; color: #8fb0ca; padding-top: 22px; border-top: 1px solid #ffffff1f; }

/* Panel borang (kanan) */
.auth-main { padding: 44px; display: grid; align-content: center; }
.auth-card { width: 100%; }
.auth-card.narrow { max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: var(--shadow-lg); }
.login-head { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.login-jata { width: 44px; height: auto; flex: none; }
.login-head .eyebrow { margin-bottom: 3px; }
.login-head h1 { margin: 0; }
.auth-card h1 { font-size: 22px; margin: 0 0 7px; letter-spacing: -0.2px; }
.login-inst { font: 700 10.5px/1.8 "Plus Jakarta Sans", sans-serif; letter-spacing: 0.9px; color: var(--navy); text-transform: uppercase; margin: 0 0 20px; }
.auth-card > p.muted { font-size: 12.5px; margin-top: 0; margin-bottom: 22px; }
.auth-card form { display: grid; gap: 15px; }
.auth-note { display: block; text-align: center; color: #9aa8b4; font-size: 10px; margin-top: 22px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.verify-box { background: #f4f8fb; border: 1px solid #e4edf3; border-radius: 9px; padding: 15px; display: grid; gap: 10px; }
.verify-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.verify-head span { color: var(--navy); font-size: 11px; font-weight: 700; }
.verify-head small { color: #8998a6; font-size: 9.5px; font-weight: 400; }
.verify-word { font: 800 26px "Plus Jakarta Sans"; color: var(--navy); letter-spacing: 6px; text-align: center; padding: 4px 0; }

/* ---------------- Halaman awam ---------------- */
.public-page { background: #fff; min-height: 100vh; }
.public-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 40px; border-bottom: 1px solid var(--line); }
.public-header .brand-mark { background: var(--navy); color: #fff; }
.public-header .brand strong { color: var(--navy); }
.public-header .brand span { color: var(--muted); }
.public-main { max-width: 820px; margin: 0 auto; padding: 44px 24px 70px; }
.public-main h1 { font-size: 31px; margin: 10px 0 14px; color: var(--navy); line-height: 1.25; }
.public-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; margin-bottom: 26px; }
.public-images { display: grid; gap: 12px; margin-bottom: 28px; }
.public-images img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.public-content { font-size: 15px; line-height: 1.85; color: #3f5265; border-top: 1px solid var(--line); padding-top: 26px; margin-bottom: 30px; }
.public-share { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 24px; }
.public-footer { text-align: center; padding: 24px; color: var(--muted-2); font-size: 11px; border-top: 1px solid var(--line); }

/* ---------------- Footer & mobile nav ---------------- */
.app-footer { display: flex; justify-content: space-between; gap: 14px; padding: 22px 40px; color: var(--muted-2); font-size: 10.5px; border-top: 1px solid var(--line); margin-top: auto; flex-wrap: wrap; }
.mobile-nav { display: none; }

/* ---------------- Responsif ---------------- */
@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .lower-grid, .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 40px #00000033; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .menu-toggle { display: block; }
  .search { width: auto; flex: 1; max-width: 320px; }
  .content { padding: 24px 18px 96px; }
  .app-footer { padding: 18px; margin-bottom: 68px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-main { padding: 34px 24px; }
  .auth-aside { padding: 32px 26px; gap: 20px; }
  .corp-photo img { height: 175px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--line); z-index: 35;
    justify-content: space-around; padding: 8px 4px 6px;
  }
  .mobile-nav a { color: #7a8997; text-decoration: none; text-align: center; font-size: 19px; min-width: 54px; padding: 2px 0; }
  .mobile-nav a.active { color: var(--navy); }
  .mobile-nav small { font-size: 9px; display: block; margin-top: 2px; }
  .public-header { padding: 16px 18px; }
  .public-main { padding: 30px 18px 60px; }
}

@media (max-width: 620px) {
  .topbar { height: 62px; }
  .search { display: none; }
  .top-actions { margin-left: auto; gap: 14px; }
  .user-text { display: none; }
  .content { padding: 20px 14px 96px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-heading h1 { font-size: 20px; }
  .page-heading p { font-size: 11.5px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .stat-card { padding: 13px 11px; gap: 10px; }
  .stat-card strong { font-size: 19px; }
  .stat-card span { font-size: 10px; }
  .stat-card small { display: none; }
  .stat-icon { width: 34px; height: 34px; font-size: 16px; }
  .stat-arrow { display: none; }
  .panel { padding: 16px 13px; }
  .panel h2 { font-size: 14px; }
  .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar select { max-width: none; }
  .calendar-grid { font-size: 11px; }
  .cal-cell { min-height: 74px; padding: 5px; }
  .cal-event { font-size: 9px; padding: 3px 4px; }
  .calendar-toolbar { flex-direction: column; align-items: stretch; }
  .profile-head { flex-direction: column; text-align: center; }
  .card-foot { flex-direction: column; align-items: flex-start; }
  .card-actions .btn { flex: 1; }
  .public-main h1 { font-size: 22px; }
  .public-content { font-size: 14px; }
  .auth-card.narrow { padding: 26px 20px; }
  .verify-word { font-size: 22px; letter-spacing: 4px; }
  th, td { padding: 11px 7px; }
  .qr-share { flex-direction: column; align-items: center; }
}

/* ---------------- Cetak ---------------- */
@media print {
  .sidebar, .topbar, .mobile-nav, .app-footer, .card-actions, .filter-bar, .segmented, .btn, .page-heading .heading-actions { display: none !important; }
  .main-area { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}
