/* ==================================================
   STYLE CLEAN FINAL
   POS App - CSS sudah dirapikan dan duplikasi utama dihapus
================================================== */

:root {
  --brand-primary: #2563eb;
  --brand-soft: #eff6ff;
  --sidebar-bg: #0f172a;
  --sidebar-card: #111c32;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --page-bg: #f3f6fb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
}

html,
body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior-y: auto;
}

.app-body {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(135deg, #f8fafc 0%, var(--brand-soft) 45%, #f1f5f9 100%);
}

/* ==================================================
   LAYOUT UTAMA
================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.main {
  width: calc(100% - 280px);
  min-height: 100vh;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  transition: all .24s ease;
}

.app-content {
  width: 100%;
  max-width: none;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1.25rem;
  padding-bottom: 16px;
}

/* Footer dibuat simple dan ringan */
.app-footer {
  width: 100%;
  margin-top: auto;
  margin-bottom: 0;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.4;
  color: #6c757d;
  text-align: center;
  background: transparent;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.footer-left,
.footer-right,
.footer-dot {
  display: none !important;
}

/* ==================================================
   SIDEBAR
================================================== */

.sidebar {
  width: 280px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  padding: 1rem;
  overflow-y: auto;
  color: #e2e8f0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .08), transparent 35%),
    linear-gradient(180deg, #101827 0%, #0f172a 100%);
  box-shadow: 12px 0 32px rgba(15, 23, 42, .14);
  transition: all .24s ease;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-footer {
  display: none !important;
}

.sidebar-mobile-close {
  display: none;
  justify-content: flex-end;
  margin-bottom: 10px;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-105%) !important;
}

body.sidebar-collapsed .main {
  width: 100% !important;
  margin-left: 0 !important;
}

body.sidebar-collapsed .sidebar-backdrop {
  display: none !important;
}

.brand-card {
  margin-bottom: 1rem;
  padding: .85rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}

.brand,
.brand-copy,
.topbar-left,
.topbar-title-wrap {
  min-width: 0;
}

.brand-logo,
.brand img.brand-logo {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  background: #1e293b;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.brand-logo-empty,
.login-logo-empty,
.preview-logo-empty,
.logo-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--brand-primary), #0f172a);
}

.brand-title {
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  color: #94a3b8;
  font-size: .8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-menu {
  display: grid;
  gap: .38rem;
}

.nav-section-label {
  padding: .6rem .75rem .25rem;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .78rem .86rem;
  color: #cbd5e1;
  border-radius: 16px;
  font-weight: 700;
  transition: .18s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  text-decoration: none;
  transform: translateX(3px);
  background: linear-gradient(135deg, var(--brand-primary), rgba(255, 255, 255, .08));
}

.nav-logout {
  margin-top: .55rem;
  color: #fecaca;
  background: rgba(239, 68, 68, .08);
}

.mini-label {
  color: #94a3b8;
  font-size: .75rem;
}

.mini-value {
  color: #fff;
  font-weight: 800;
}

.sidebar-toggle-btn,
.sidebar-collapse-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #0f172a !important;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .06);
}

.sidebar-toggle-btn:hover,
.sidebar-collapse-btn:hover {
  background: var(--brand-primary) !important;
  color: #fff !important;
}

.mobile-toggle {
  display: none;
}

/* ==================================================
   TOPBAR
================================================== */

.topbar {
  min-height: 64px !important;
  height: 64px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px !important;
  position: sticky;
  top: 0;
  z-index: 40 !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
}

.topbar-brand,
.topbar-logo,
.topbar-brand img {
  display: none !important;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar-business {
  display: none;
}

.page-title,
.page-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 850;
}

.page-subtitle {
  color: #64748b;
  font-size: .82rem;
}

.user-pill {
  padding: .5rem .75rem;
  border-radius: 16px;
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .1);
}

/* ==================================================
   KOMPONEN UMUM
================================================== */

.page-hero,
.dashboard-hero,
.bill-hero,
.project-hero,
.users-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), #0f172a) !important;
  box-shadow: 0 22px 44px rgba(15, 23, 42, .13);
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: 26px;
}

.page-hero::after,
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}

.page-hero > *,
.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.page-hero h2,
.dashboard-hero h2 {
  margin: .25rem 0;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 850;
}

.page-hero p,
.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
}

.eyebrow,
.hero-badge {
  color: rgba(255, 255, 255, .7);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  letter-spacing: 0;
  text-transform: none;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-hero .btn-light,
.hero-actions .btn-light,
.dashboard-main-hero .btn-light {
  border: none !important;
  color: #0f172a !important;
  font-weight: 800;
  background: rgba(255, 255, 255, .92) !important;
}

.card,
.modern-card,
.dashboard-panel,
.project-panel,
.user-panel {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.card-header {
  color: #0f172a;
  font-weight: 850;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.card-body {
  position: relative;
}

.modern-card,
.dashboard-panel,
.project-panel,
.user-panel {
  padding: 20px;
}

.modern-card-header,
.dashboard-panel-header,
.project-panel-header,
.user-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modern-card-header h5,
.dashboard-panel-header h5,
.project-panel-header h5,
.user-panel-header h5 {
  margin: 0;
  color: #0f172a;
  font-weight: 900;
}

.modern-card-header p,
.dashboard-panel-header p,
.project-panel-header p,
.user-panel-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.form-control,
.form-select {
  border-radius: 14px;
  background: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}

.btn {
  border-radius: 14px;
  font-weight: 800;
}

.btn-primary,
.bg-primary {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}

.badge,
.dashboard-chip,
.dashboard-badge,
.current-user-badge,
.role-badge,
.self-note {
  border-radius: 999px;
}

.table th {
  white-space: nowrap;
}

.modern-table,
.dashboard-table,
.project-table,
.user-table {
  margin-bottom: 0;
}

.modern-table thead th,
.dashboard-table thead th,
.project-table thead th,
.user-table thead th {
  padding: 12px;
  white-space: nowrap;
  color: #475569;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.modern-table tbody td,
.dashboard-table tbody td,
.project-table tbody td,
.user-table tbody td {
  padding: 14px 12px;
  color: #334155;
  border-bottom: 1px solid #eef2f7;
}

.modern-table tbody tr:hover,
.dashboard-table tbody tr:hover,
.project-table tbody tr:hover,
.user-table tbody tr:hover {
  background: #f8fafc;
}

.table-title,
.table-date,
.project-name,
.customer-name,
.project-price,
.username-text,
.user-fullname {
  color: #0f172a;
  font-weight: 900;
}

.project-location,
.customer-phone,
.user-phone,
.kpi-sub {
  color: #64748b;
  font-size: 13px;
}

.stat-blue,
.bg-blue {
  background: #dbeafe;
}

.stat-green,
.bg-green {
  background: #dcfce7;
}

.stat-purple,
.bg-purple {
  background: #ede9fe;
}

.stat-orange,
.bg-orange {
  background: #ffedd5;
}

.progress-warning {
  background: var(--warning) !important;
}

.progress-primary {
  background: var(--brand-primary) !important;
}

.progress-success {
  background: var(--success) !important;
}

/* ==================================================
   DASHBOARD
================================================== */

.dashboard-modern {
  width: 100%;
  padding-bottom: 24px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: 22px;
}

.dashboard-main-hero {
  margin-bottom: 22px !important;
}

.modern-stat-card,
.dashboard-kpi-card,
.bill-stat-card,
.project-stat-card,
.user-stat-card {
  height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  transition: .2s ease;
}

.modern-stat-card:hover,
.dashboard-kpi-card:hover,
.bill-stat-card:hover,
.project-stat-card:hover,
.user-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .09);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.stat-label,
.kpi-label,
.bill-stat-card p,
.project-stat-card p,
.user-stat-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.stat-value,
.kpi-value,
.bill-stat-card h3,
.project-stat-card h3,
.user-stat-card h3 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.8px;
}

.stat-money,
.kpi-money,
.bill-stat-card .bill-money {
  font-size: 22px;
}

.stat-icon,
.kpi-icon,
.bill-stat-icon,
.project-stat-icon,
.user-stat-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  font-size: 24px;
  background: var(--brand-soft);
}

.stat-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  font-size: 13px;
  border-top: 1px solid #eef2f7;
}

.stat-footer span,
.summary-item span,
.summary-list-modern span,
.completion-card span,
.completion-box span {
  color: #64748b;
  font-size: 13px;
}

.stat-footer strong,
.summary-item strong,
.summary-list-modern strong,
.completion-card strong,
.completion-box strong {
  color: #0f172a;
  font-weight: 900;
}

.dashboard-chip,
.dashboard-badge {
  padding: 7px 12px;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  background: var(--brand-soft);
}

.project-progress-list,
.project-status-list,
.summary-list,
.summary-list-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-status-list,
.project-progress-list {
  gap: 18px;
}

.project-status-item,
.summary-item,
.summary-list-modern div {
  padding: 13px 14px;
  border-radius: 15px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.project-status-item {
  padding: 16px;
  border-radius: 18px;
}

.progress-info,
.status-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-info strong,
.status-info strong {
  display: block;
  color: #0f172a;
  font-weight: 900;
}

.progress-info span,
.status-info span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
}

.progress-info b,
.status-info b {
  color: #0f172a;
  font-size: 22px;
}

.modern-progress,
.dashboard-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.summary-item,
.summary-list-modern div,
.completion-card,
.completion-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.completion-card,
.completion-box {
  justify-content: flex-start;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border: 1px solid rgba(148, 163, 184, .22);
}

.completion-percent,
.completion-number {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  background: var(--brand-primary);
}

/* ==================================================
   BILL
================================================== */

.bill-table-card {
  overflow: hidden;
}

.bill-filter,
.project-filter {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.bill-filter {
  grid-template-columns: 1.4fr 180px 180px 150px auto;
}

.project-filter {
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.filter-actions,
.project-filter-actions,
.bill-actions,
.project-actions,
.user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bill-actions,
.project-actions,
.user-actions {
  justify-content: flex-end;
}

.row-void {
  color: #991b1b;
  background: #fff7f7 !important;
}

.row-void .table-title,
.row-void .fw-semibold {
  color: #991b1b !important;
}

.bill-form-modern,
.bill-create-full {
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  align-self: stretch !important;
}

.bill-form-modern > .row,
.bill-create-layout {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 360px !important;
  gap: 18px !important;
  align-items: start !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.bill-form-modern > .row > .col-xl-8,
.bill-form-modern > .row > .col-xl-4,
.bill-create-left,
.bill-create-right {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: unset !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.bill-form-modern .modern-card,
.bill-create-full .modern-card,
.bill-summary-card {
  width: 100% !important;
}

.bill-form-modern .form-control,
.bill-form-modern .form-select,
.bill-create-full .form-control,
.bill-create-full .form-select {
  min-height: 44px !important;
}

.items-wrapper-modern {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row,
.item-row-modern,
.item-row-full,
.bill-form-modern .item-row,
.bill-form-modern .item-row-modern {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(350px, 1fr) 130px 220px 56px !important;
  gap: 12px !important;
  align-items: end !important;
  margin: 0 !important;
  padding: 12px !important;
  border-radius: 18px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.sticky-summary {
  position: sticky !important;
  top: 84px !important;
}

.grand-total-box {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand-primary), #0f172a);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
}

.grand-total-box span {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 750;
}

.grand-total-box strong {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.6px;
  text-align: right;
}

.btn-outline-secondary {
  color: #475569;
  border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
  color: #fff;
  background: #475569;
}

.btn-outline-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-outline-danger:hover {
  color: #fff;
  background: #dc2626;
}

/* ==================================================
   PROJECT DAN USER PAGE
================================================== */

.project-total-box {
  min-width: 190px;
  padding: 12px 16px;
  text-align: right;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border: 1px solid rgba(148, 163, 184, .22);
}

.project-total-box span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.project-total-box strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 17px;
  font-weight: 900;
}

.user-profile-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-primary), #0f172a);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .20);
}

.user-fullname {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.current-user-badge {
  padding: 3px 8px;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 900;
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
}

.role-badge,
.self-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
}

.role-admin,
.btn-project-edit,
.btn-user-edit {
  color: #2563eb !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
}

.role-staff,
.self-note {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.btn-project-edit:hover,
.btn-user-edit:hover {
  color: #fff !important;
  background: #2563eb !important;
}

.btn-project-print,
.btn-export-excel {
  color: #fff !important;
  border: none !important;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  box-shadow: 0 10px 20px rgba(22, 163, 74, .22) !important;
}

.btn-project-print:hover,
.btn-export-excel:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #15803d, #166534) !important;
  transform: translateY(-1px);
}

.btn-project-delete,
.btn-user-disable {
  color: #dc2626 !important;
  background: #fff1f2 !important;
  border: 1px solid #fecaca !important;
}

.btn-user-disable {
  color: #ea580c !important;
  background: #fff7ed !important;
  border-color: #fed7aa !important;
}

.btn-project-delete:hover,
.btn-user-disable:hover {
  color: #fff !important;
  background: #dc2626 !important;
}

.btn-user-disable:hover {
  background: #ea580c !important;
}

.btn-user-enable {
  color: #16a34a !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
}

.btn-user-enable:hover {
  color: #fff !important;
  background: #16a34a !important;
}

.btn-export-pdf {
  color: #fff !important;
  border: none !important;
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
  box-shadow: 0 10px 20px rgba(220, 38, 38, .22) !important;
}

.btn-export-pdf:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
  transform: translateY(-1px);
}

.btn-export-excel,
.btn-export-pdf {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 16px !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
  border-radius: 14px !important;
}

/* ==================================================
   SETTINGS DAN PREVIEW
================================================== */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

.settings-main,
.settings-preview {
  min-width: 0;
}

.sticky-preview {
  position: sticky;
  top: 95px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #475569;
  font-size: .88rem;
}

.preview-app {
  overflow: hidden;
  border-radius: 22px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.preview-sidebar {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .9rem;
  color: #fff;
  background: #0f172a;
}

.preview-logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  object-fit: cover;
}

.preview-sidebar strong,
.preview-sidebar span {
  display: block;
}

.preview-sidebar strong {
  font-size: .88rem;
}

.preview-sidebar span {
  color: #94a3b8;
  font-size: .72rem;
}

.preview-nav,
.preview-topbar {
  margin: .5rem;
  padding: .65rem;
  border-radius: 12px;
  background: #fff;
}

.preview-nav {
  padding: .55rem .65rem;
  color: #475569;
  font-size: .86rem;
}

.preview-nav.active {
  color: #fff;
  background: var(--brand-primary);
}

.preview-topbar {
  color: #0f172a;
  font-weight: 800;
}

.preview-content {
  display: flex;
  gap: .5rem;
  padding: .5rem;
}

.preview-card {
  height: 58px;
  flex: 1;
  border-radius: 14px;
  background: var(--brand-soft);
}

.preview-card.small-card {
  flex: .75;
  background: #fff;
  border: 1px solid var(--border);
}

.preview-footer {
  padding: .6rem;
  color: #64748b;
  font-size: .76rem;
  background: #fff;
  border-top: 1px solid var(--border);
}

.logo-preview {
  width: 96px;
  height: 96px;
  margin-left: auto;
  margin-right: auto;
  object-fit: cover;
  border-radius: 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.business-preview {
  padding: 1rem;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px dashed #dbe3ef;
}

.mobile-color-input {
  width: 100% !important;
  height: 46px !important;
  padding: 6px !important;
}

.settings-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.settings-switch input {
  display: none;
}

.settings-switch span {
  width: 46px;
  height: 26px;
  position: relative;
  flex: 0 0 46px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: .2s ease;
}

.settings-switch span::after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 999px;
  background: #fff;
  transition: .2s ease;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .18);
}

.settings-switch input:checked + span {
  background: var(--brand-primary);
}

.settings-switch input:checked + span::after {
  left: 23px;
}

.settings-switch strong,
.settings-switch small {
  display: block;
}

.settings-switch strong {
  color: #0f172a;
  font-weight: 900;
}

.settings-switch small {
  margin-top: 2px;
  color: #64748b;
}

.mobile-preview-phone {
  width: 210px;
  height: 380px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  border-radius: 32px;
  background: var(--mobile-preview-bg);
  border: 8px solid #0f172a;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

.mobile-preview-status {
  height: 24px;
  background: var(--mobile-preview-color);
}

.mobile-preview-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.mobile-preview-header img,
.mobile-preview-logo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 12px;
}

.mobile-preview-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: var(--mobile-preview-color);
}

.mobile-preview-header strong,
.mobile-preview-header span {
  display: block;
}

.mobile-preview-header strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.1;
}

.mobile-preview-header span {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.mobile-preview-card {
  height: 80px;
  margin: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--mobile-preview-color), #0f172a);
}

.mobile-preview-card.small {
  height: 105px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.mobile-preview-bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  text-align: center;
  font-size: 18px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

/* ==================================================
   LOGIN
================================================== */

.login-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, var(--brand-soft), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 52%, #f1f5f9 100%);
}

.login-shell,
.login-shell-modern {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
}

.login-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-hero-card {
  width: min(620px, 100%);
  position: relative;
  overflow: hidden;
  padding: 2.3rem;
  color: #fff;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--brand-primary), #0f172a);
  box-shadow: 0 30px 70px rgba(15, 23, 42, .22);
}

.login-hero-card::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
}

.login-logo {
  width: 78px;
  height: 78px;
  margin-bottom: 1.2rem;
  object-fit: cover;
  border-radius: 24px;
  background: #fff;
}

.login-kicker {
  color: rgba(255, 255, 255, .68);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: .35rem 0 .55rem;
  font-size: 2.35rem;
  line-height: 1.05;
}

.login-hero p {
  max-width: 520px;
  color: rgba(255, 255, 255, .78);
  font-size: 1rem;
}

.login-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1.5rem;
}

.login-info-grid div {
  padding: .9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
}

.login-info-grid span,
.login-info-grid strong {
  display: block;
}

.login-info-grid span {
  margin-bottom: .25rem;
  color: rgba(255, 255, 255, .7);
  font-size: .78rem;
}

.login-info-grid strong {
  color: #fff;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  background: rgba(255, 255, 255, .54);
  backdrop-filter: blur(16px);
}

.login-card {
  width: min(440px, 94vw);
  border-radius: 26px;
}

.login-card-logo {
  width: 74px !important;
  height: 74px !important;
  padding: 6px !important;
  object-fit: contain !important;
  border-radius: 22px !important;
  background: #fff !important;
}

.login-input,
.login-submit {
  min-height: 46px !important;
  border-radius: 16px !important;
}

.login-input {
  font-size: 15px !important;
}

.login-submit {
  font-weight: 900 !important;
}

.login-default-info {
  border-radius: 16px !important;
}

.mobile-login-brand {
  display: none;
}

.login-footer {
  margin-top: 1rem;
  color: #64748b;
  font-size: .85rem;
  text-align: center;
}

/* ==================================================
   PWA DAN MOBILE BOTTOM NAV
================================================== */

.btn-install-pwa,
.pwa-install-floating {
  color: #fff !important;
  border: none !important;
  font-weight: 850 !important;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

.btn-install-pwa {
  padding: 9px 14px !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 22px rgba(22, 163, 74, .18);
}

.pwa-install-floating {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 80;
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: 0 16px 35px rgba(22, 163, 74, .28);
}

.mobile-bottom-nav {
  display: none;
}

.mobile-bottom-nav a.active {
  color: var(--brand-primary) !important;
  background: var(--brand-soft);
}

.mobile-nav-icon {
  display: block;
  line-height: 1;
}

.mobile-nav-text,
.mobile-bottom-nav small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1;
}

@media (display-mode: standalone) {
  .btn-install-pwa,
  .pwa-install-floating {
    display: none !important;
  }
}

/* ==================================================
   PRINT, STRUK, OFFER
================================================== */

.print-area {
  color: #111;
  background: #fff;
}

.receipt {
  max-width: 320px;
  margin: 0 auto;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.receipt .logo {
  max-width: 65px;
  max-height: 65px;
  object-fit: contain;
}

.receipt table {
  width: 100%;
  border-collapse: collapse;
}

.receipt td {
  padding: 3px 0;
  vertical-align: top;
}

.receipt .line {
  margin: 8px 0;
  border-top: 1px dashed #111;
}

.receipt.receipt-large {
  color: #000 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
  font-weight: 500 !important;
}

.receipt.receipt-large.receipt-80 {
  max-width: 430px !important;
}

.receipt.receipt-large.receipt-58 {
  max-width: 330px !important;
}

.receipt.receipt-large .logo {
  max-width: 90px !important;
  max-height: 90px !important;
  object-fit: contain !important;
}

.receipt.receipt-large .fw-bold {
  font-weight: 800 !important;
}

.receipt.receipt-large table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.receipt.receipt-large td {
  padding: 4px 0 !important;
  vertical-align: top !important;
}

.receipt.receipt-large .line {
  margin: 10px 0 !important;
  border-top: 2px dashed #000 !important;
}

.receipt.receipt-large .text-center .fw-bold {
  font-size: 17px !important;
}

.receipt.receipt-large tr:last-child .fw-bold,
.receipt.receipt-large td.fw-bold {
  font-size: 18px !important;
}

.offer {
  max-width: 900px;
  margin: 0 auto;
  padding: 34px;
  font-family: Arial, sans-serif;
  border-radius: 20px;
  background: #fff;
}

.offer-logo {
  max-width: 85px;
  max-height: 85px;
  object-fit: contain;
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (min-width: 941px) {
  .sidebar {
    transform: translateX(0);
  }

  .main {
    width: calc(100% - 280px);
    margin-left: 280px;
  }

  .sidebar-backdrop {
    display: none !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
  }
}

@media (min-width: 1400px) {
  .bill-create-layout {
    grid-template-columns: minmax(0, 1fr) 380px !important;
  }

  .item-row,
  .item-row-modern,
  .item-row-full {
    grid-template-columns: minmax(360px, 1fr) 130px 210px 56px !important;
  }
}

@media (min-width: 1500px) {
  .bill-form-modern > .row {
    grid-template-columns: minmax(0, 1fr) 380px !important;
    gap: 20px !important;
  }

  .bill-form-modern .item-row,
  .bill-form-modern .item-row-modern {
    grid-template-columns: minmax(520px, 1fr) 140px 240px 56px !important;
  }
}

@media (max-width: 1199px) {
  .bill-form-modern > .row,
  .bill-create-layout {
    grid-template-columns: 1fr !important;
  }

  .sticky-summary {
    position: static !important;
  }
}

@media (max-width: 1100px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .sticky-preview {
    position: static;
  }

  .bill-filter {
    grid-template-columns: 1fr 1fr;
  }

  .filter-search,
  .filter-actions {
    grid-column: span 2;
  }
}

@media (max-width: 992px) {
  .project-panel-header,
  .user-panel-header {
    flex-direction: column;
  }

  .project-total-box,
  .user-panel-header .btn {
    width: 100%;
    text-align: left;
  }

  .project-filter {
    grid-template-columns: 1fr;
  }

  .project-filter-actions .btn {
    flex: 1;
  }
}

@media (max-width: 940px) {
  html,
  body {
    width: 100%;
    min-height: 100dvh;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y;
    overscroll-behavior-y: auto;
  }

  body {
    position: static !important;
  }

  body.sidebar-open {
    overflow: hidden !important;
  }

  body:not(.sidebar-open) {
    overflow-y: auto !important;
  }

  .app-shell {
    display: block !important;
    height: auto !important;
    min-height: 100dvh;
    max-height: none !important;
    overflow: visible !important;
  }

  .main {
    width: 100% !important;
    min-height: 100vh !important;
    margin-left: 0 !important;
  }

  .app-content {
    height: auto !important;
    min-height: 100dvh;
    max-height: none !important;
    padding: 12px !important;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }

  body.mobile-bottom-nav-enabled .app-content {
    padding-bottom: 95px !important;
  }

  .sidebar {
    width: min(86vw, 310px) !important;
    z-index: 90 !important;
    transform: translateX(-105%) !important;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .sidebar.show {
    transform: translateX(0) !important;
  }

  .sidebar-backdrop.show {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 85 !important;
    background: rgba(15, 23, 42, .52) !important;
    backdrop-filter: blur(3px);
  }

  .sidebar-mobile-close {
    display: flex;
  }

  .sidebar-collapse-btn,
  .btn-install-pwa {
    display: none !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
  }

  .topbar {
    height: auto !important;
    min-height: 64px !important;
    padding: 10px 12px !important;
    gap: 10px;
    position: sticky !important;
    top: 0 !important;
  }

  .topbar-left {
    flex: 1;
    min-width: 0;
  }

  .topbar-right {
    flex: 0 0 auto;
    gap: .35rem;
  }

  .user-pill {
    max-width: 120px;
    padding: 7px 10px !important;
    border-radius: 14px !important;
  }

  .user-pill .fw-semibold,
  .user-pill .small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-hero,
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px !important;
    border-radius: 22px !important;
  }

  .page-hero h2,
  .dashboard-hero h2 {
    font-size: 1.25rem !important;
  }

  .page-hero p,
  .dashboard-hero p {
    font-size: .9rem !important;
  }

  .hero-actions,
  .page-hero .hero-actions {
    width: 100%;
  }

  .hero-actions .btn,
  .page-hero .hero-actions .btn {
    width: 100%;
  }

  .card,
  .modern-card,
  .project-panel,
  .user-panel {
    border-radius: 18px !important;
  }

  .table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .sticky-summary,
  .sticky-preview {
    position: static !important;
    top: auto !important;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 62px;
    z-index: 1050;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .95);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #64748b;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
  }

  .mobile-bottom-nav a:hover {
    color: var(--brand-primary);
    background: var(--brand-soft);
  }

  .pwa-install-floating {
    bottom: calc(85px + env(safe-area-inset-bottom)) !important;
    z-index: 1060;
  }

  .app-footer {
    padding: 10px 12px 85px;
    font-size: 11px;
  }

  .login-bg {
    background: linear-gradient(135deg, #f8fafc 0%, var(--brand-soft) 48%, #eef2ff 100%) !important;
  }

  .login-shell,
  .login-shell-modern {
    display: block !important;
    width: 100% !important;
    min-height: 100vh !important;
  }

  .login-hero {
    display: none !important;
  }

  .login-panel {
    width: 100% !important;
    min-height: 100vh !important;
    justify-content: flex-start !important;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom)) !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .mobile-login-brand {
    width: 100%;
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  }

  .mobile-login-brand img,
  .mobile-login-logo-empty {
    width: 52px;
    height: 52px;
    min-width: 52px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
  }

  .mobile-login-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    background: var(--brand-primary);
  }

  .mobile-login-brand h1 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
  }

  .mobile-login-brand p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
  }

  .login-card {
    width: 100% !important;
    max-width: 430px !important;
    margin: 0 auto !important;
    border-radius: 26px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12) !important;
  }

  .login-card .card-body {
    padding: 24px 20px !important;
  }

  .login-card-logo {
    width: 70px !important;
    height: 70px !important;
    border-radius: 20px !important;
  }

  .login-card-heading h3 {
    color: #0f172a !important;
    font-size: 22px !important;
    font-weight: 900 !important;
  }

  .login-card-heading .text-muted {
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .login-footer {
    width: 100%;
    max-width: 430px;
    margin: 14px auto 0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }
}

@media (max-width: 768px) {
  .dashboard-hero,
  .modern-card-header,
  .dashboard-panel-header,
  .project-panel-header,
  .user-panel-header {
    flex-direction: column;
  }

  .dashboard-kpi-card,
  .modern-stat-card,
  .bill-stat-card,
  .project-stat-card,
  .user-stat-card {
    padding: 16px;
  }

  .stat-value,
  .kpi-value,
  .bill-stat-card h3,
  .project-stat-card h3,
  .user-stat-card h3 {
    font-size: 26px;
  }

  .stat-money,
  .kpi-money,
  .bill-stat-card .bill-money {
    font-size: 20px;
  }

  .completion-card,
  .completion-box {
    align-items: flex-start;
  }

  .bill-filter,
  .project-filter {
    grid-template-columns: 1fr;
  }

  .filter-search,
  .filter-actions {
    grid-column: auto;
  }

  .filter-actions .btn,
  .project-filter-actions .btn {
    flex: 1;
  }

  .item-row,
  .item-row-modern,
  .item-row-full,
  .bill-form-modern .item-row,
  .bill-form-modern .item-row-modern {
    grid-template-columns: 1fr 1fr !important;
  }

  .item-row .remove-item,
  .item-row-modern .remove-item,
  .item-row-full .remove-item,
  .bill-form-modern .remove-item {
    grid-column: span 2 !important;
    width: 100% !important;
  }

  .bill-actions,
  .project-actions,
  .user-actions {
    justify-content: flex-start;
  }

  .grand-total-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .grand-total-box strong {
    font-size: 22px;
    text-align: left;
  }

  .project-table tbody td,
  .user-table tbody td {
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: .75rem !important;
  }

  .app-content {
    padding: .85rem !important;
  }

  .page-title {
    font-size: .92rem !important;
  }

  .page-subtitle {
    max-width: 150px;
    font-size: .72rem !important;
  }

  .user-pill {
    max-width: 96px;
  }

  .settings-layout {
    gap: .75rem;
  }

  .login-panel {
    padding: 1rem;
  }

  .login-card {
    border-radius: 22px;
  }

  .bill-create-layout {
    gap: 12px !important;
  }

  .bill-create-full .modern-card {
    padding: 16px !important;
    border-radius: 18px !important;
  }

  .item-row,
  .item-row-modern,
  .item-row-full,
  .bill-form-modern .item-row,
  .bill-form-modern .item-row-modern {
    grid-template-columns: 1fr !important;
  }

  .item-row .remove-item,
  .item-row-modern .remove-item,
  .item-row-full .remove-item,
  .bill-form-modern .remove-item {
    grid-column: auto !important;
  }
}

@media (max-width: 420px) {
  .login-panel {
    padding: 14px 10px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-login-brand {
    padding: 12px;
    border-radius: 20px;
  }

  .mobile-login-brand img,
  .mobile-login-logo-empty {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .mobile-login-brand h1 {
    font-size: 16px;
  }

  .login-card {
    border-radius: 22px !important;
  }

  .login-card .card-body {
    padding: 20px 16px !important;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .no-print,
  .sidebar,
  .topbar,
  .app-footer,
  .footer-left,
  .footer-right,
  .sidebar-backdrop {
    display: none !important;
    visibility: hidden !important;
  }

  .main {
    width: 100% !important;
    margin: 0 !important;
  }

  .container-fluid,
  .app-content {
    padding: 0 !important;
  }

  .card {
    border: 0 !important;
    box-shadow: none !important;
  }

  .print-area {
    display: block;
  }

  .receipt,
  .offer {
    margin: 0 auto;
    box-shadow: none;
  }

  .offer {
    padding: 0;
    border-radius: 0;
  }

  .receipt.receipt-large {
    font-size: 18px !important;
    line-height: 1.35 !important;
  }

  .receipt.receipt-large.receipt-80 {
    width: 80mm !important;
    max-width: 80mm !important;
  }

  .receipt.receipt-large.receipt-58 {
    width: 58mm !important;
    max-width: 58mm !important;
    font-size: 13px !important;
  }

  .receipt.receipt-large .logo {
    max-width: 80px !important;
    max-height: 80px !important;
  }
}
