/* ============================================================
   OLT Monitoring — App styles (production)
   Drop ke: public/css/app.css
   Tambahkan di layout SEBELUM </head>:
     <link rel="stylesheet" href="{{ asset('css/tokens.css') }}">
     <link rel="stylesheet" href="{{ asset('css/app.css') }}">
   ============================================================ */

/* ─── Reset basics ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 13px; line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--fg-link); text-decoration: none; }
a:hover { color: var(--fg-link-hover); }
button { font: inherit; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-content { padding: 24px; max-width: 1440px; margin: 0 auto; width: 100%; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--chrome-bg);
  color: var(--chrome-fg-1);
  padding: 14px 12px;
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  border-right: 1px solid var(--chrome-border);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar__logo  { width: 36px; height: auto; flex-shrink: 0; }
.sidebar__brand-text { line-height: 1.15; }
.sidebar__product { font-size: 14px; font-weight: 700; color: var(--chrome-fg-1); letter-spacing: -0.01em; }
.sidebar__owner   { font-size: 10px; font-weight: 500; color: var(--chrome-fg-3); letter-spacing: 0.08em; margin-top: 2px; }
.sidebar__section-label {
  font-size: 10px; font-weight: 600; color: var(--chrome-fg-3);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px 6px;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar__nav:last-of-type { flex: initial; }
.sidebar__divider { margin: 8px 0; height: 1px; background: var(--chrome-border); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--chrome-fg-2);
  font-size: 13px; font-weight: 500;
  position: relative; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--chrome-hover); color: var(--chrome-fg-1); }
.nav-item.is-active {
  background: var(--chrome-active-bg);
  color: var(--chrome-active-fg);
  font-weight: 600;
}
.nav-item__bar {
  position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  background: var(--chrome-active-bar); border-radius: 0 3px 3px 0;
}

.sidebar__user {
  margin-top: 10px; padding: 10px;
  background: var(--chrome-hover); border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar__avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.sidebar__user-meta { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 12px; font-weight: 600; color: var(--chrome-fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 10px; color: var(--chrome-fg-3); }
.sidebar__logout {
  width: 28px; height: 28px; border: none; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--chrome-fg-3); border-radius: 6px;
}
.sidebar__logout:hover { background: var(--chrome-hover); color: var(--chrome-fg-1); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: 56px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 5;
}
.topbar__back {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-1);
  background: #fff; color: var(--fg-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar__back:hover { color: var(--fg-1); border-color: var(--slate-400); }
.topbar__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.topbar__crumbs { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fg-3); }
.topbar__crumb--current { color: var(--fg-2); }
.topbar__title { font-size: 16px; font-weight: 600; color: var(--fg-1); letter-spacing: -0.01em; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-1);
  background: #fff; cursor: pointer; color: var(--fg-2);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.topbar__icon-btn:hover { color: var(--fg-1); border-color: var(--slate-400); }
.topbar__icon-dot {
  position: absolute; top: 7px; right: 7px; width: 6px; height: 6px;
  border-radius: 999px; background: var(--red-600); border: 1.5px solid #fff;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--border-1);
  border-radius: 12px; padding: 16px;
}
.card--p20 { padding: 20px; }
.card--p0  { padding: 0; }
.card__header {
  padding: 14px 20px; border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; gap: 12px;
}
.card__title { font-size: 14px; font-weight: 700; color: var(--fg-1); margin: 0; }
.card__subtitle { font-size: 11px; color: var(--fg-3); margin: 2px 0 0; }
.card__body { padding: 16px 20px; }

/* Icon tile (32x32 tinted) */
.icon-tile {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-tile--blue  { background: var(--blue-50);  color: var(--blue-700); }
.icon-tile--green { background: var(--green-50); color: var(--green-700); }
.icon-tile--amber { background: var(--amber-50); color: var(--amber-700); }
.icon-tile--red   { background: var(--red-50);   color: var(--red-700); }
.icon-tile--slate { background: var(--slate-100); color: var(--slate-600); }
.icon-tile--lg    { width: 44px; height: 44px; border-radius: 10px; }
.icon-tile--sm    { width: 28px; height: 28px; border-radius: 6px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  white-space: nowrap; text-decoration: none; font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 9px; }
.btn--full { width: 100%; }

.btn--primary { background: var(--blue-600); color: #fff; }
.btn--primary:hover { background: var(--blue-700); color: #fff; }

.btn--success { background: var(--green-600); color: #fff; }
.btn--success:hover { background: var(--green-700); color: #fff; }

.btn--ghost { background: #fff; color: var(--fg-2); border: 1.5px solid var(--border-1); }
.btn--ghost:hover { color: var(--fg-1); border-color: var(--slate-400); }

.btn--danger { background: var(--red-50); color: var(--red-700); }
.btn--danger:hover { background: var(--red-100); }

.btn--plain { background: transparent; color: var(--fg-2); }
.btn--plain:hover { background: var(--slate-100); color: var(--fg-1); }

/* ============================================================
   INPUTS / FIELDS
   ============================================================ */
.input {
  width: 100%; height: 36px; padding: 0 12px; font-size: 13px;
  border: 1.5px solid var(--border-input); border-radius: 8px;
  background: var(--bg-surface-2); color: var(--fg-1);
  outline: none; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--blue-600); background: #fff; }
.input.has-error { border-color: var(--red-600); }
.input--mono { font-family: var(--font-mono); }
.input--readonly { background: var(--slate-50); cursor: not-allowed; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 40px; }
.input__addon {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-3); width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.input__addon:hover { color: var(--fg-1); }

.input-search {
  position: relative; flex: 1; min-width: 180px;
}
.input-search > svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--slate-400); pointer-events: none;
}
.input-search .input { padding-left: 32px; }
.input-search:focus-within > svg { color: var(--blue-600); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__row { display: flex; align-items: center; gap: 8px; }
.field__row .field__label { flex: 1; }
.field__label { font-size: 12px; font-weight: 600; color: var(--fg-1); }
.field__link { font-size: 11px; color: var(--blue-600); font-weight: 500; }
.field__error { font-size: 11px; color: var(--red-700); margin-top: 4px; }

.checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--fg-2); cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--blue-600); }

/* Select with icon prefix */
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap__icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--slate-500); pointer-events: none; z-index: 1; line-height: 0; }
.select-wrap__chevron { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--slate-500); pointer-events: none; line-height: 0; }
.select-wrap select {
  height: 36px; padding: 0 26px 0 30px; font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border-input); border-radius: 8px;
  background: var(--bg-surface-2); color: var(--fg-1);
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  min-width: 110px; font-family: inherit; outline: none; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.select-wrap select:focus { border-color: var(--blue-600); background: #fff; }

/* ============================================================
   FILTER BAR / STATS BAR (existing class names from custom.css preserved)
   ============================================================ */
.olt-filter-form,
.olt-stats-bar {
  background: #fff; border: 1px solid var(--border-1);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}
.olt-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.olt-filter-divider { width: 1px; height: 22px; background: var(--border-1); flex-shrink: 0; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap, .olt-table-wrap {
  background: #fff; border: 1px solid var(--border-1);
  border-radius: 12px; overflow: hidden;
}
.table-wrap table, .olt-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--font-sans); }
.table-wrap th, .olt-table-wrap th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-2); background: var(--slate-50);
  font-weight: 600; border-bottom: 1px solid var(--border-1);
}
.table-wrap td, .olt-table-wrap td {
  padding: 12px 12px; vertical-align: middle;
  border-top: 1px solid var(--border-1);
}
.table-wrap tr:hover td, .olt-table-wrap tr:hover td { background: var(--slate-50); }
.td-mono { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.td-dim  { color: var(--fg-2); }

/* ============================================================
   STATUS CHIPS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.chip__dot { width: 6px; height: 6px; border-radius: 50%; }
.chip--online  { background: var(--green-50); color: var(--green-700); }
.chip--online  .chip__dot { background: var(--green-600); }
.chip--offline { background: var(--red-50);   color: var(--red-700); }
.chip--offline .chip__dot { background: var(--red-600); }
.chip--los     { background: var(--amber-50); color: var(--amber-700); }
.chip--los     .chip__dot { background: var(--amber-600); }
.chip--idle    { background: var(--slate-100); color: var(--slate-600); }
.chip--idle    .chip__dot { background: var(--slate-400); }

/* ============================================================
   GPS + FOTO (existing class names preserved from custom.css)
   ============================================================ */
.olt-location-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 640px) { .olt-location-section { grid-template-columns: 1fr; } }

.olt-gps-card, .olt-foto-card {
  background: #fff; border: 1px solid var(--border-1);
  border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.olt-card-header { display: flex; align-items: center; gap: 12px; }
.olt-card-header-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.olt-gps-card  .olt-card-header-icon { background: var(--blue-50);  color: var(--blue-700); }
.olt-foto-card .olt-card-header-icon { background: var(--green-50); color: var(--green-700); }
.olt-card-title { font-size: 14px; font-weight: 700; color: var(--fg-1); margin: 0; }
.olt-card-subtitle { font-size: 11px; color: var(--fg-3); margin: 1px 0 0; }

.olt-gps-placeholder {
  background: var(--slate-50); border-radius: 10px; min-height: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--fg-3); font-size: 12px; padding: 14px;
}
.olt-gps-coords {
  background: var(--slate-50); border: 1px solid var(--border-1);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--fg-1); font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px;
}
.olt-btn-gps {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 38px; background: var(--blue-600); color: #fff;
  border: none; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.olt-btn-gps:hover { background: var(--blue-700); }

.olt-foto-dropzone {
  border: 2px dashed var(--slate-300); border-radius: 10px;
  min-height: 130px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--fg-3); font-size: 12px; cursor: pointer; position: relative;
  transition: border-color .2s, background .2s, color .2s;
}
.olt-foto-dropzone:hover {
  border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700);
}
.olt-foto-dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.olt-btn-foto {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 38px; background: var(--green-600); color: #fff;
  border: none; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.olt-btn-foto:hover { background: var(--green-700); }

.olt-foto-preview {
  border-radius: 10px; overflow: hidden; position: relative; background: var(--slate-100);
}
.olt-foto-preview img { width: 100%; height: 160px; object-fit: cover; display: block; }

/* ============================================================
   AUTH (login)
   ============================================================ */
.auth-shell { min-height: 100vh; background: var(--bg-page); }
.auth-grid  { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
@media (max-width: 800px) { .auth-grid { grid-template-columns: 1fr; } .auth-hero-pane { display: none; } }

.auth-form-pane { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.auth-logo { width: 44px; height: auto; }
.auth-brand-product { font-size: 16px; font-weight: 700; color: var(--fg-1); letter-spacing: -0.01em; }
.auth-brand-owner   { font-size: 10px; font-weight: 500; color: var(--fg-3); letter-spacing: 0.08em; margin-top: 2px; }
.auth-title { font-size: 24px; font-weight: 700; color: var(--fg-1); letter-spacing: -0.02em; margin: 0; }
.auth-subtitle { font-size: 14px; color: var(--fg-2); margin: 8px 0 28px; }
.auth-form-body { display: flex; flex-direction: column; gap: 16px; }
.auth-form-body .input { height: 40px; padding: 0 12px; font-size: 14px; background: #fff; }
.auth-foot { font-size: 11px; color: var(--fg-3); text-align: center; margin-top: 8px; }
.auth-foot a { color: var(--blue-600); font-weight: 500; }
.auth-copyright { margin-top: auto; font-size: 11px; color: var(--fg-3); padding-top: 24px; }

.auth-hero-pane {
  background: var(--chrome-bg); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.auth-hero-pattern { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.18; }
.auth-hero { position: relative; color: #fff; max-width: 420px; }
.auth-pill {
  display: inline-flex; padding: 4px 10px; border-radius: 999px;
  background: rgba(59,130,246,0.16); color: #DBEAFE;
  font-size: 11px; font-weight: 600; margin-bottom: 16px; letter-spacing: 0.04em;
}
.auth-hero-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.auth-hero-sub   { color: #94A3B8; display: block; }
.auth-stats { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-stat {
  padding: 14px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-stat__label { font-size: 10px; font-weight: 600; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-stat__value { font-size: 22px; font-weight: 700; color: #fff; font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 4px; }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-shell {
  min-height: 100vh; background: var(--bg-page);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.error-card {
  max-width: 540px; width: 100%;
  background: #fff; border: 1px solid var(--border-1);
  border-radius: 16px; padding: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  text-align: center;
}
.error-brand { display: flex; align-items: center; gap: 10px; }
.error-brand img { width: 28px; height: auto; }
.error-brand span { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.error-icon {
  width: 96px; height: 96px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
}
.error-icon--amber { background: var(--amber-50); color: var(--amber-700); }
.error-icon--red   { background: var(--red-50); color: var(--red-700); }
.error-code {
  font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-family: var(--font-mono); color: var(--fg-1); font-variant-numeric: tabular-nums;
}
.error-title { font-size: 20px; font-weight: 600; margin: 16px 0 0; letter-spacing: -0.01em; }
.error-message { font-size: 14px; color: var(--fg-2); margin: 8px auto 0; max-width: 400px; line-height: 1.5; }
.error-actions { display: flex; gap: 8px; }
.error-foot {
  margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--border-1);
  width: 100%; font-size: 11px; color: var(--fg-3);
}
.error-foot a { color: var(--blue-600); font-weight: 500; }

/* ============================================================
   UTILITIES
   ============================================================ */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.subtle { color: var(--fg-3); }
.link { color: var(--blue-600); font-weight: 500; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { position: fixed; transform: translateX(-100%); z-index: 100; transition: transform .2s; }
  .sidebar.is-open { transform: translateX(0); }
  .app-content { padding: 16px; }
}


/* Helper grids & stat chips for Blade views.
   Append ke akhir app.css ATAU drop sebagai file terpisah. */
.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2to1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 900px) {
  .grid--2, .grid--3, .grid--4, .grid--2to1 { grid-template-columns: 1fr; }
}

/* Stat chip (clickable counter on stats bar) */
.stat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.stat-chip--slate { background: var(--slate-50);  color: var(--slate-700); }
.stat-chip--green { background: var(--green-50);  color: var(--green-700); }
.stat-chip--red   { background: var(--red-50);    color: var(--red-700); }
.stat-chip--amber { background: var(--amber-50);  color: var(--amber-700); }
.stat-chip.is-active { border-color: currentColor; opacity: 0.95; }
.stat-chip:hover { opacity: 0.85; }
