:root {
  --sidebar-collapsed: 72px;
  --sidebar-expanded: 240px;
  --content-gap-collapsed: 42px;
  --content-gap-expanded: 34px;
  --content-right-gap: 30px;
  --adhi-maroon: #7a1020;
  --adhi-red: #b51e2b;
  --adhi-red-soft: #fff1f2;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --warning: #92400e;
  --warning-bg: #fffbeb;
  --success: #166534;
  --success-bg: #ecfdf5;
  --danger: #991b1b;
  --danger-bg: #fef2f2;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(181, 30, 43, 0.10), transparent 28rem),
    linear-gradient(180deg, #fff, var(--bg));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.25), transparent 16rem),
    linear-gradient(135deg, var(--adhi-maroon), var(--adhi-red));
}

.login-shell {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  align-items: stretch;
}

.login-hero,
.login-card,
.control-card,
.metric-card,
.table-card,
.lock-banner {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.login-hero {
  min-height: 540px;
  padding: 48px;
  color: white;
  background:
    linear-gradient(135deg, rgba(122, 16, 32, 0.92), rgba(181, 30, 43, 0.86)),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.16'%3E%3Cpath d='M0 60h120M60 0v120M20 0l100 100M0 20l100 100'/%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: white;
  color: var(--adhi-red);
  font-weight: 900;
  letter-spacing: -0.08em;
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--adhi-red);
}

.login-hero .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.login-hero h1,
.topbar h1 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.login-hero h1 {
  max-width: 640px;
  font-size: clamp(42px, 5vw, 72px);
}

.hero-copy {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.hero-badges span {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.login-card {
  padding: 36px;
  align-self: center;
}

.login-card h2,
.control-card h2,
.table-header h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.table-header h2 {
  font-size: 24px;
}

.login-card p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

label {
  font-size: 13px;
  font-weight: 400;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  border-color: var(--adhi-red);
  box-shadow: 0 0 0 4px rgba(181, 30, 43, 0.12);
}

input:disabled {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.outline-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 900;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.outline-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--adhi-maroon), var(--adhi-red));
  box-shadow: 0 12px 24px rgba(181, 30, 43, 0.28);
}

.secondary-btn {
  color: var(--adhi-red);
  background: var(--adhi-red-soft);
}

.outline-btn {
  color: var(--adhi-maroon);
  background: #ffffff;
  border: 1px solid rgba(181, 30, 43, 0.25);
}

.ghost-btn {
  color: var(--ink);
  background: #f3f4f6;
}

.ghost-btn.light {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.side-tab-link {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1200;
  text-decoration: none;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
  height: 48px;
  width: 52px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(135deg, var(--adhi-maroon), var(--adhi-red));
  box-shadow: 0 10px 20px rgba(122, 16, 32, 0.35);
  transition: width 0.24s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.side-tab-link:hover {
  width: 230px;
  filter: brightness(1.06);
}

.side-tab-icon {
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 14px;
  line-height: 1;
}

.side-tab-text {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.side-tab-link:hover .side-tab-text {
  opacity: 1;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
}

.hidden {
  display: none !important;
}

.message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.message.hidden {
  display: none;
}

.message.error {
  color: var(--danger);
  background: var(--danger-bg);
}

.message.success {
  color: var(--success);
  background: var(--success-bg);
}

.message.warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.topbar {
  padding: 32px min(48px, 5vw);
  color: white;
  background:
    linear-gradient(135deg, rgba(122, 16, 32, 0.97), rgba(181, 30, 43, 0.95)),
    radial-gradient(circle at right top, rgba(255, 255, 255, 0.18), transparent 22rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.topbar.with-sidebar,
.shell {
  margin-left: calc(var(--sidebar-collapsed) + var(--content-gap-collapsed));
  margin-right: var(--content-right-gap);
  width: auto;
  max-width: calc(100% - (var(--sidebar-collapsed) + var(--content-gap-collapsed) + var(--content-right-gap)));
  transition: margin-left 0.22s ease, max-width 0.22s ease;
}

.sidebar-static {
  position: fixed;
  left: 0;
  top: 0;
  width: 72px;
  height: 100vh;
  padding: 18px 10px;
  color: white;
  background: linear-gradient(180deg, rgba(122, 16, 32, 0.98), rgba(181, 30, 43, 0.95));
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1200;
  transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar-static:hover {
  width: var(--sidebar-expanded);
  padding: 18px 14px;
}

.sidebar-static:hover ~ .topbar.with-sidebar,
.sidebar-static:hover ~ .shell {
  margin-left: calc(var(--sidebar-expanded) + var(--content-gap-expanded));
  max-width: calc(100% - (var(--sidebar-expanded) + var(--content-gap-expanded) + var(--content-right-gap)));
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.sidebar-item {
  color: white;
  text-decoration: none;
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-weight: 800;
  font-size: 14px;
}

.sidebar-label {
  opacity: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  transition: opacity 0.12s ease;
}

.sidebar-static:hover .sidebar-label {
  opacity: 1;
}

.sidebar-static:hover .sidebar-item {
  padding-right: 14px;
}

.topbar h1 {
  font-size: clamp(32px, 4vw, 56px);
}

.topbar .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.topbar-copy {
  max-width: 720px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  min-width: 190px;
  padding: 12px 16px;
  border-radius: 18px;
  color: white;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.user-chip span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.68);
}

.user-chip strong {
  display: block;
  margin-top: 3px;
}

.shell {
  margin-top: -16px;
  margin-bottom: 48px;
  display: grid;
  gap: 18px;
}

.control-card {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.35fr;
  gap: 20px;
  align-items: end;
}

.controls-grid {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.lock-banner {
  padding: 18px 20px;
  border-color: rgba(146, 64, 14, 0.20);
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.lock-banner strong {
  color: var(--warning);
}

.lock-banner p {
  margin: 4px 0 0;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-card {
  padding: 22px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.metric-card.warning {
  background: var(--warning-bg);
}

.table-card {
  overflow: hidden;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.welcome-card-link {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 24px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.welcome-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(31, 41, 55, 0.14);
}

.welcome-card-link h2 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.welcome-card-link .muted {
  margin: 0;
}

.table-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.table-header .muted {
  margin-bottom: 0;
}

.table-actions {
  min-width: min(560px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.proyek-aktif-actions {
  min-width: min(900px, 100%);
  grid-template-columns: minmax(460px, 1fr) auto auto;
  align-items: center;
}

.proyek-aktif-search {
  min-width: 460px;
}

.slim-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

.export-right {
  justify-self: end;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(12px, 0.72vw, 14px);
}

th,
td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  word-break: break-word;
}

th:first-child,
td:first-child {
  width: 44px;
  max-width: 44px;
  text-align: center;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
  color: #374151;
  font-size: clamp(10px, 0.62vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: #fff7f7;
}

.money-input,
.note-input {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
}

.date-input {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
}

.note-input {
  min-width: 0;
}

.laba-cell {
  color: var(--adhi-maroon);
}

.dept-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dept-pill {
  color: var(--info);
  background: var(--info-bg);
}

.status-ok {
  color: var(--success);
  background: var(--success-bg);
}

.status-missing {
  color: var(--warning);
  background: var(--warning-bg);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .login-shell,
  .control-card {
    grid-template-columns: 1fr;
  }

  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .table-actions {
    min-width: 100%;
  }

  .proyek-aktif-actions {
    grid-template-columns: 1fr auto auto;
  }

  .proyek-aktif-search {
    min-width: 320px;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar-static {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px;
  }

  .sidebar-static:hover {
    width: 100%;
    padding: 12px;
  }

  .sidebar-label {
    opacity: 1;
  }

  .topbar.with-sidebar,
  .shell {
    margin-left: 16px;
    margin-right: 16px;
    width: auto;
    max-width: calc(100% - 32px);
  }

  .side-tab-link {
    top: auto;
    bottom: 12px;
    transform: none;
    border-radius: 10px;
    left: 12px;
    right: 12px;
    width: auto;
    text-align: center;
    justify-content: center;
  }

  .side-tab-text {
    opacity: 1;
  }

  .topbar,
  .topbar-right,
  .lock-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .login-hero {
    min-height: auto;
    padding: 32px;
  }

  .login-card,
  .control-card,
  .table-header,
  .metric-card {
    padding: 18px;
  }

  .controls-grid,
  .metrics-grid,
  .table-actions {
    grid-template-columns: 1fr;
  }

  .proyek-aktif-search {
    min-width: 0;
  }
}
