/* =========================================================
   KasirPOS — Web Dashboard
   Design tokens matched to Flutter style.dart
   Primary: #00BFA5 (AppColors.primary)
   ========================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Brand — from AppColors */
  --primary:        #00BFA5;
  --primary-dark:   #00A98A;
  --primary-light:  #E0F2F1;
  --primary-xlight: #eaf7f3;

  /* Text — from AppColors */
  --text-primary:   #212121;
  --text-dark:      #333333;
  --text-secondary: #666666;
  --text-hint:      #999999;

  /* Neutrals — from AppColors */
  --grey:           #888888;
  --grey-light:     #999999;
  --grey-border:    #BDBDBD;
  --grey-border-lt: #E5E5E5;
  --background:     #F2F2F2;
  --light-bg:       #F5F5F5;
  --very-light-bg:  #FAFAFA;
  --ultra-light-bg: #F8F9FA;

  /* Status — from AppColors */
  --success:        #4CAF50;
  --warning:        #FF9800;
  --error:          #FF3B30;

  /* Layout */
  --sidebar-w:      248px;
  --topbar-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --card-shadow:    0 2px 8px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.04);

  /* Fonts */
  --font-display:   'Space Grotesk', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--text-primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   SIDEBAR — white, teal accents (matches Android app)
   ========================================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--grey-border-lt);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--grey-border-lt);
}

.brand-icon {
  width: 38px; height: 38px;
  /*background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);*/
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  flex-shrink: 0;
  /*box-shadow: 0 2px 8px rgba(0,191,165,0.35);*/
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--primary);
}

.sidebar-nav {
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
  background: var(--primary-xlight);
  color: var(--primary-dark);
}

.sidebar-nav .nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav .nav-link.active i {
  color: var(--primary);
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--grey);
  transition: color 0.15s;
}

.sidebar-nav .nav-link:hover i {
  color: var(--primary);
}

.nav-section-label {
  padding: 14px 12px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--grey-light);
}

.sidebar-user {
  border-top: 1px solid var(--grey-border-lt);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--very-light-bg);
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-info { overflow: hidden; }

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.7rem;
  color: var(--text-hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--grey-border-lt);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* =========================================================
   KPI CARDS
   ========================================================= */
.kpi-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--grey-border-lt);
  transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0,191,165,0.12), 0 1px 4px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.kpi-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Teal icon for first card */
.kpi-icon.teal {
  background: var(--primary-light);
  color: var(--primary);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* Override Bootstrap bg-primary-subtle for teal */
.bg-primary-subtle { background-color: var(--primary-light) !important; }
.text-primary      { color: var(--primary) !important; }
.bg-primary        { background-color: var(--primary) !important; border-color: var(--primary) !important; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  border-radius: var(--radius) !important;
  box-shadow: var(--card-shadow) !important;
  border: 1px solid var(--grey-border-lt) !important;
}

.card-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* =========================================================
   TABLES
   ========================================================= */
.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.table td {
  color: var(--text-dark);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: var(--primary-xlight);
}

/* =========================================================
   PRODUCT LIST
   ========================================================= */
.product-row {
  border-bottom: 1px solid var(--grey-border-lt);
}
.product-row:last-child { border-bottom: none; }

/* =========================================================
   SUBSCRIPTION / PLAN
   ========================================================= */
.plan-badge {
  font-family: var(--font-display);
  font-size: 1rem !important;
  background: var(--primary) !important;
}

.plan-features li {
  padding: 5px 0;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.upgrade-banner {
  border-radius: var(--radius) !important;
  background: linear-gradient(135deg, var(--primary-xlight) 0%, var(--primary-light) 100%) !important;
  border-color: rgba(0,191,165,0.3) !important;
  color: var(--text-primary) !important;
}

.upgrade-banner strong { color: var(--primary-dark); }

/* =========================================================
   PROFILE PAGE
   ========================================================= */
.avatar-lg {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,191,165,0.3);
}

.meta-block { margin-bottom: 10px; }

.meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.meta-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.letter-spacing-1 { letter-spacing: 0.06em; }

/* =========================================================
   FORMS
   ========================================================= */
.form-label { color: var(--text-dark); font-size: 0.875rem; }

.form-control, .form-select {
  border-color: var(--grey-border);
  border-radius: var(--radius-sm) !important;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder { color: var(--text-hint); }

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,191,165,0.15);
  outline: none;
}

.input-group .form-control   { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.input-group-text             { border-color: var(--grey-border); background: var(--ultra-light-bg); color: var(--grey); }
.input-group .btn             { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

.form-text { color: var(--text-hint); font-size: 0.8rem; }

/* =========================================================
   BUTTONS — teal primary
   ========================================================= */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  box-shadow: 0 4px 12px rgba(0,191,165,0.35) !important;
  transform: translateY(-1px);
}

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

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  color: var(--text-secondary) !important;
  border-color: var(--grey-border) !important;
  background: #fff !important;
}

.btn-outline-secondary:hover {
  background: var(--light-bg) !important;
  color: var(--text-primary) !important;
}

.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }

/* =========================================================
   BADGES — teal theme
   ========================================================= */
.badge.bg-primary        { background: var(--primary) !important; }
.badge.bg-success        { background: var(--success) !important; }
.badge.bg-warning        { background: var(--warning) !important; }
.badge.bg-danger         { background: var(--error) !important; }

.bg-success-subtle       { background-color: #E8F5E9 !important; }
.text-success            { color: var(--success) !important; }
.border-success-subtle   { border-color: #A5D6A7 !important; }

.bg-danger-subtle        { background-color: #FFEBEE !important; }
.text-danger             { color: var(--error) !important; }

.bg-warning-subtle       { background-color: #FFF3E0 !important; }
.text-warning            { color: var(--warning) !important; }

.bg-info-subtle          { background-color: #E3F2FD !important; }
.text-info               { color: #2196F3 !important; }

/* =========================================================
   ALERTS
   ========================================================= */
.alert-success {
  background: #E8F5E9;
  border-color: #A5D6A7;
  color: #2E7D32;
  border-radius: var(--radius-sm) !important;
}

.alert-danger {
  background: #FFEBEE;
  border-color: #EF9A9A;
  color: #C62828;
  border-radius: var(--radius-sm) !important;
}

.alert-info {
  background: var(--primary-xlight);
  border-color: rgba(0,191,165,0.3);
  color: var(--primary-dark);
  border-radius: var(--radius-sm) !important;
}

/* =========================================================
   AUTH LAYOUT
   ========================================================= */
.auth-body {
  background: var(--background);
}

.auth-split {
  display: flex;
  min-height: 100vh;
}

.auth-panel {
  width: 42%;
  background: linear-gradient(160deg, #00BFA5 0%, #00897B 50%, #004D40 100%);
  padding: 48px 52px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* Decorative circles on auth panel */
.auth-panel::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}

.auth-panel::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand { position: relative; z-index: 1; }

.auth-panel-content { position: relative; z-index: 1; }

.auth-panel-features { position: relative; z-index: 1; }

.auth-tagline {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.auth-sub {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-panel-features { display: flex; flex-direction: column; gap: 10px; }

.auth-feature {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.auth-form-panel {
  flex: 1;
  padding: 32px 24px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--grey-border-lt);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.brand-icon-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}

/* =========================================================
   CHART AREA
   ========================================================= */
canvas { border-radius: var(--radius-sm); }

/* =========================================================
   SCROLLBAR (webkit)
   ========================================================= */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey); }

.brand-icon img{
	width:40px;
}
/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 767.98px) {
  .kpi-value { font-size: 1.25rem; }
  .auth-card { padding: 28px 20px; }
  .auth-panel { display: none; }
  .auth-form-panel { padding: 24px 16px; }
}
