/* ====================================================================
  SIMS — Custom Theme
   Berisi: layout sidebar+main, sidebar dark, cards, tables, login, dll
   ==================================================================== */
:root {
  --sidebar-w: 260px;
  --sidebar-bg: #111827;
  --sidebar-bg-2: #1f2937;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --bg: #f3f4f6;
  --text-muted: #6b7280;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: #1f2937;
}

/* ===== App layout ============================================== */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #d1d5db;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-nav { padding: .75rem .65rem 2rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .8rem; margin: .1rem 0;
  border-radius: 8px; color: #d1d5db;
  text-decoration: none; font-size: .9rem;
  transition: background .15s, color .15s;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.25rem; }
.sidebar-section {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.4); padding: 1rem .85rem .35rem;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0; min-height: 100vh;
  display: flex; flex-direction: column;
}

.navbar-app {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: .6rem 1rem;
  display: flex; align-items: center; gap: .75rem;
  position: sticky; top: 0; z-index: 50;
}
.page-content { flex: 1; }

/* ===== Cards =================================================== */
.card {
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  border-radius: 14px;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
}

.stat-card { transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

/* ===== Tables ================================================= */
.table-modern {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
.table-modern thead th {
  background: #f8fafc; color: var(--text-muted);
  text-transform: uppercase; font-size: .72rem; letter-spacing: .05em;
  border-bottom: 1px solid #eef2f7; font-weight: 600;
}
.table-modern tbody tr:hover { background: #fafbff; }
.table-modern td, .table-modern th { vertical-align: middle; }

/* ===== Brand colors override Bootstrap ======================== */
.btn-primary { background-color: var(--brand); border-color: var(--brand); }
.btn-primary:hover,
.btn-primary:focus { background-color: #4338ca; border-color: #4338ca; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background-color: var(--brand); border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary  { background-color: var(--brand) !important; }
.btn-soft-primary {
  background-color: rgba(79,70,229,.1);
  color: var(--brand);
  border: 1px solid rgba(79,70,229,.2);
}
.btn-soft-primary:hover { background-color: var(--brand); color: #fff; }

/* ===== Login page ============================================= */
.login-page {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  min-height: 100vh;
}
.login-card { border: 0; border-radius: 18px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }

/* ===== Responsive ============================================= */
@media (max-width: 767.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 99;
  }
  .sidebar-backdrop.show { display: block; }
}
@media (min-width: 768px) {
  .sidebar-backdrop { display: none !important; }
}

/* ===== Utility ================================================ */
.cursor-pointer { cursor: pointer; }
.text-monospace { font-family: SFMono-Regular, Menlo, Consolas, monospace; }
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; opacity: .4; }

.transaction-thumbnail {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.product-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
}
.product-detail-image {
  width: 100%;
  height: 260px;
  border-radius: 12px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}
.product-form-image {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}
.product-image-empty {
  background: #f1f5f9;
  color: #94a3b8;
  align-items: center;
  justify-content: center;
}
.product-detail-image.product-image-empty {
  display: flex;
  font-size: 3rem;
}
