/* 
  Rentalan Design System CSS
  Based on style-guide.html & gambaran-platform-rental.html
*/

:root {
  /* Colors */
  --bg: #F5FAFF;
  --surface: #FFFFFF;
  --ink: #152238;
  --muted: #5C7089;
  --line: #E3ECF7;
  --brand: #2F80ED;
  --brand-deep: #1B5FBD;
  --brand-soft: #E8F1FE;
  --sun: #FFC93C;
  --sun-soft: #FFF6DC;
  --tersedia: #17A398;
  --tersedia-soft: #E4F7F4;
  --disewa: #E8963C;
  --disewa-soft: #FDF0E1;
  --offline: #C4432E;
  --offline-soft: #FBE7E2;

  /* Shadow */
  --shadow: 0 8px 24px rgba(21, 34, 56, 0.06);
  --shadow-lg: 0 16px 40px rgba(21, 34, 56, 0.10);

  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 11px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-3xl: 18px;
  --radius-4xl: 20px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: 36px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
h4 { font-size: 16px; font-weight: 700; }

code, .mono, pre {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

p {
  margin: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.btn-ghost {
  background: var(--surface);
  color: var(--brand-deep);
  border: 1.5px solid var(--brand-soft);
}

.btn-ghost:hover {
  background: var(--brand-soft);
}

.btn-sun {
  background: var(--sun);
  color: #4a3400;
}

.btn-sun:hover {
  background: #ffb800;
}

.btn-teal {
  background: var(--tersedia);
  color: #fff;
}

.btn-teal:hover {
  opacity: 0.9;
}

.btn-danger-ghost {
  background: var(--surface);
  color: var(--offline);
  border: 1.5px solid var(--offline-soft);
}

.btn-danger-ghost:hover {
  background: var(--offline-soft);
}

.btn.disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== Chips / Badges ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.chip-tersedia {
  background: var(--tersedia-soft);
  color: #0f6f65;
}

.chip-disewa {
  background: var(--disewa-soft);
  color: #96601c;
}

.chip-offline {
  background: var(--offline-soft);
  color: #8c3122;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-sm {
  padding: 16px;
  border-radius: var(--radius-xl);
}

.card-lg {
  padding: 24px;
}

/* ===== Navigation ===== */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--brand-deep);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nav-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===== KPI Cards ===== */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--ink);
}

.kpi-delta {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
}

.kpi-delta.up {
  color: var(--tersedia);
}

.kpi-delta.warn {
  color: var(--disewa);
}

.kpi-delta.down {
  color: var(--offline);
}

/* ===== Forms ===== */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-select {
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

table tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover {
  background: var(--bg);
}

/* ===== Grid & Layout ===== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== Utilities ===== */
.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--sun-soft);
  color: #8a6400;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Animations ===== */
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fade-in {
  animation: fadein 0.25s ease forwards;
}

/* ===== Utilities Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }

.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }

.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-brand { color: var(--brand); }
.text-tersedia { color: var(--tersedia); }
.text-disewa { color: var(--disewa); }
.text-offline { color: var(--offline); }

.bg-bg { background: var(--bg); }
.bg-surface { background: var(--surface); }
.bg-brand-soft { background: var(--brand-soft); }
.bg-sun-soft { background: var(--sun-soft); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 13.5px; }
.text-lg { font-size: 14.5px; }
.text-xl { font-size: 17px; }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
