﻿/* =========================================================
   OKA ADVOCATE & PARTNERS — ADMIN DESIGN SYSTEM
   Responsive · Accessible · No external dependencies
   ========================================================= */

:root {
  --black: #0B1B2B;
  --navy: #0F2E5D;
  --blue: #114B9B;
  --blue-light: #2E7BE6;
  --gold: #C89E3C;
  --gold-light: #F2D694;
  --cream: #F8F5EC;

  --bg: #F3F5F9;
  --card: #FFFFFF;
  --ink: #17263A;
  --muted: #53647A;
  --line: #D7DFE9;

  --ok: #146B46;
  --ok-bg: #E5F4EB;
  --err: #A12626;
  --err-bg: #FCEAEA;
  --warn: #805A0A;
  --warn-bg: #FFF2D5;
  --info: #174D91;
  --info-bg: #E8F0FC;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(11, 27, 43, .045);
  --shadow-hover: 0 7px 22px rgba(11, 27, 43, .09);
  --sidebar-width: 260px;
}

/* Reset */

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-light);
  text-decoration: underline;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  color: var(--black);
  line-height: 1.3;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(21px, 2vw, 26px);
  letter-spacing: -.45px;
}

h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

p {
  margin-top: 0;
}

small,
.muted {
  color: var(--muted);
}

::selection {
  color: var(--black);
  background: var(--gold-light);
}

/* Keyboard accessibility */

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--blue-light) !important;
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue-light) !important;
  outline-offset: 3px;
}

/* Main application layout */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */

.side {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  padding: 22px 15px 16px;
  color: #FFFFFF;
  background: linear-gradient(
    160deg,
    var(--black) 0%,
    var(--navy) 100%
  );
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0 2px 27px;
  padding: 0 4px;
}

.brand .mark {
  display: grid;
  place-items: center;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  color: var(--black);
  background: linear-gradient(
    135deg,
    var(--gold-light),
    var(--gold)
  );
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.5px;
}

.brand strong {
  display: block;
  color: #FFFFFF;
  font-size: 14px;
  line-height: 1.4;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #C5D1E1;
  font-size: 11px;
}

/* Navigation */

.side nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #526B89 transparent;
}

.side nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #E8EEF7;
  font-size: 13px;
  font-weight: 500;
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}

.side nav a svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}

.side nav a:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,.09);
  text-decoration: none;
}

.side nav a.on {
  color: var(--black);
  background: var(--gold-light);
  border-color: #E7C46F;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.side nav a.on svg {
  color: var(--navy);
}

.side .grp {
  display: block;
  margin: 17px 11px 5px;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.who {
  display: grid;
  gap: 3px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 16px 5px 2px;
  border-top: 1px solid rgba(255,255,255,.19);
}

.who small {
  color: #C4D0DF;
  font-size: 11px;
}

.who strong {
  color: #FFFFFF;
  font-size: 13px;
}

button.link {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 0;
  border: 0;
  color: var(--gold-light);
  background: transparent;
  font: inherit;
  font-weight: 600;
}

button.link:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Main content */

.main {
  min-width: 0;
  padding: 27px 30px 60px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.top h1 {
  min-width: 0;
}

.top form {
  flex-shrink: 0;
  margin: 0;
}

.center {
  width: min(100%, 460px);
  margin: 8vh auto;
  padding: 0 16px;
}

/* Cards and content grids */

.card {
  min-width: 0;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: #C9D5E4;
}

.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid > *,
.g2 > *,
.g4 > * {
  min-width: 0;
}

/* Statistics */

.stat {
  position: relative;
  min-height: 112px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #FFFFFF;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat b {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 29px;
  font-weight: 750;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat.warn b {
  color: var(--err);
}

.stat a {
  color: inherit;
  text-decoration: none;
}

.stat a:hover {
  color: var(--blue);
}

/* Alerts */

.flash {
  margin-bottom: 17px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
}

.flash.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: #B8DFC8;
}

.flash.err {
  color: var(--err);
  background: var(--err-bg);
  border-color: #EABEBE;
}

.note {
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid #E9D6A8;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: #60450A;
  background: #FFF8E8;
  font-size: 13px;
}

.note.red {
  color: #812323;
  background: var(--err-bg);
  border-color: #E7BDBD;
  border-left-color: var(--err);
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 13px 11px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  color: #43556C;
  background: #F7F9FC;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .45px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #F8FAFD;
}

td strong,
td b {
  color: var(--navy);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFFFFF;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 650px;
}

/* Status badges */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--info);
  background: var(--info-bg);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.pill.baru {
  color: #704900;
  background: #FFF0CC;
  border-color: #F3DDA7;
}

.pill.klien {
  color: #12613D;
  background: #DDF2E6;
  border-color: #B9E1CA;
}

.pill.spam,
.pill.tidak_lanjut {
  color: #485567;
  background: #E9EDF2;
  border-color: #D7DEE7;
}

.pill.off {
  color: #596579;
  background: #EEF1F5;
  border-color: #D9DFE7;
}

/* Forms */

form.f {
  min-width: 0;
}

form.f label {
  display: block;
  margin: 15px 0 6px;
  color: #25374D;
  font-size: 13px;
  font-weight: 650;
}

form.f .hint,
.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #C4CEDB;
  border-radius: 8px;
  color: var(--ink);
  background: #FFFFFF;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #8FA5C0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(46,123,230,.12);
}

input::placeholder,
textarea::placeholder {
  color: #68788C;
  opacity: 1;
}

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

textarea.tall {
  min-height: 230px;
}

textarea.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  vertical-align: middle;
  cursor: pointer;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #65758A;
  background: #F0F3F7;
  cursor: not-allowed;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 450;
}

.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fields {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 21px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 41px;
  padding: 9px 17px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #FFFFFF;
  background: var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

.btn:hover {
  color: #FFFFFF;
  background: #0D3D80;
  border-color: #0D3D80;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.gold {
  color: var(--black);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: #B78A2D;
}

.btn.gold:hover {
  color: var(--black);
  background: #E7BF64;
}

.btn.ghost {
  color: var(--blue);
  background: #FFFFFF;
  border-color: #B9C8DB;
}

.btn.ghost:hover {
  color: var(--navy);
  background: #F0F5FC;
  border-color: var(--blue);
}

.btn.danger {
  color: #A12626;
  background: #FFFFFF;
  border-color: #C85C5C;
}

.btn.danger:hover {
  color: #FFFFFF;
  background: #A12626;
  border-color: #A12626;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Images and logo */

.thumb {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #F4F6F9;
}

.bare .card {
  box-shadow: 0 12px 35px rgba(11,27,43,.12);
}

.logo-big {
  margin-bottom: 20px;
  text-align: center;
}

.logo-big .mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #D9B75F;
  border-radius: 15px;
  color: var(--black);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  font-size: 21px;
  font-weight: 850;
}

/* Dynamic lists */

[data-list] .rows {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.li > input[type="text"] {
  flex: 1;
}

.li.pair .fields {
  flex: 1;
  display: grid;
  gap: 8px;
}

.li.pair textarea {
  min-height: 75px;
}

.ico {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 38px;
  padding: 0;
  border: 1px solid #C4CEDB;
  border-radius: 8px;
  color: var(--muted);
  background: #FFFFFF;
  font-size: 15px;
  cursor: pointer;
}

.ico:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: #F3F7FD;
}

.ico.del:hover {
  color: var(--err);
  border-color: var(--err);
  background: var(--err-bg);
}

/* Search and document checklist */

.searchbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}

.searchbar input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.searchbar select {
  width: auto;
  min-width: 145px;
}

table.chk {
  min-width: 760px;
  table-layout: fixed;
}

table.chk th,
table.chk td {
  padding: 10px 8px;
}

table.chk td {
  vertical-align: middle;
}

table.chk input[type="text"],
table.chk input[type="date"] {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
}

table.chk th:nth-child(1),
table.chk td:nth-child(1) {
  width: 72px;
  text-align: center;
}

table.chk th:nth-child(3),
table.chk td:nth-child(3) {
  width: 150px;
}

table.chk th:nth-child(4),
table.chk td:nth-child(4) {
  width: 24%;
}

table.chk th:nth-child(5),
table.chk td:nth-child(5) {
  width: 64px;
  text-align: center;
}

table.chk tr.done td {
  background: #EDF7F0;
}

table.chk tr.done:hover td {
  background: #E5F2E9;
}

form.f:has(table.chk) {
  max-width: 100%;
  overflow-x: auto;
}

/* Additional layout helpers */

.pair {
  min-width: 0;
}

.li.pair {
  display: flex;
}

.fields > * {
  min-width: 0;
}

.empty-state {
  padding: 38px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 15px;
}

.empty-state p {
  margin: 0 0 15px;
}

.divider {
  height: 1px;
  margin: 18px 0;
  border: 0;
  background: var(--line);
}

.center {
  text-align: center;
}

/* Scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: #BAC5D3 transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: #BAC5D3;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Tablet */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 235px;
  }

  .main {
    padding: 24px 20px 45px;
  }

  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 18px;
  }
}

/* Mobile */

@media (max-width: 760px) {
  .app {
    display: flex;
    flex-direction: column;
  }

  .side {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 13px 12px 12px;
    overflow: visible;
  }

  .brand {
    margin: 0 3px 12px;
  }

  .brand .mark {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }

  .side nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 4px 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .side nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 12px;
  }

  .side nav a svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .side .grp {
    display: none;
  }

  .who {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-top: 2px;
    padding: 10px 4px 0;
  }

  .who small {
    width: auto;
  }

  .who strong {
    font-size: 12px;
  }

  .who button.link {
    margin: 0 0 0 auto;
  }

  .main {
    width: 100%;
    padding: 20px 15px 40px;
  }

  .top {
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
  }

  .top h1 {
    font-size: 20px;
  }

  .top .btn {
    min-height: 37px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .g4,
  .g2,
  .row2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    min-height: 96px;
    padding: 14px;
  }

  .stat b {
    font-size: 24px;
  }

  .stat span {
    font-size: 12px;
  }

  .card {
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .searchbar {
    align-items: stretch;
  }

  .searchbar input[type="text"] {
    min-width: 100%;
  }

  .searchbar select {
    flex: 1;
    min-width: 0;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table:not(.chk) {
    min-width: 580px;
  }

  form.f:has(table.chk) {
    overflow-x: auto;
  }

  .actions {
    gap: 8px;
  }
}

/* Small mobile */

@media (max-width: 420px) {
  .main {
    padding: 16px 11px 32px;
  }

  .top {
    flex-wrap: wrap;
  }

  .top h1 {
    width: 100%;
  }

  .top form {
    width: 100%;
  }

  .top form .btn {
    width: 100%;
  }

  .g4,
  .g2,
  .row2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat {
    min-height: 82px;
  }

  .stat b {
    font-size: 23px;
  }

  .card {
    padding: 14px;
  }

  .btn {
    min-height: 40px;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  .li {
    flex-wrap: wrap;
  }

  .li.pair .fields {
    flex-basis: 100%;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Penyesuaian layar pendek: seluruh menu tetap terlihat tanpa menggulir */
@media (min-width: 901px) and (max-height: 960px) {
  .brand { margin-bottom: 14px; }
  .side nav { gap: 2px; }
  .side nav a { min-height: 36px; padding: 6px 12px; }
  .side .grp { margin-top: 11px; }
}

/* Tautan di dalam konten lebih jelas */
.main .card a:not(.btn):not(.pill):not(.ico) { font-weight: 600; }
.main td a { text-underline-offset: 3px; }

/* ===== Perbaikan responsif (audit): tabel bisa digeser di layar sempit, teks panjang tidak melebarkan halaman ===== */
.card { overflow-x: auto; }
td, th { overflow-wrap: break-word; }
td.detail, td small { overflow-wrap: anywhere; }
.card table { min-width: 100%; }
@media (max-width: 900px) {
  .card table:not(.chk) { min-width: 560px; }
  table.chk { min-width: 720px; }
}
html, body { max-width: 100%; overflow-x: hidden; }

/* ukuran huruf minimum agar nyaman dibaca */
th { font-size: 12px; }
.nav-section, .side-section, .nav-label { font-size: 11px; }
.side .grp { font-size: 11px; }
