@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Serif+Display&display=swap');

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

:root {
  --bg:           #F7F5F2;
  --surface:      #FFFFFF;
  --border:       #E5E2DC;
  --border-dark:  #CCC8C0;
  --text:         #1A1816;
  --muted:        #8A8580;
  --accent:       #2D5016;
  --accent-light: #EFF5E8;
  --accent-mid:   #4A7C28;
  --danger:       #C0392B;
  --danger-light: #FFEBEE;
  --warning:      #E8A020;
  --warning-light:#FFF8E1;
  --info:         #1A5276;
  --info-light:   #EBF5FB;
  --success:      #2E7D32;
  --success-light:#E8F5E9;
  --font:         'DM Sans', sans-serif;
  --serif:        'DM Serif Display', serif;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow:       0 2px 12px rgba(0,0,0,0.07);
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* ── Login ── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap  { width: 100%; max-width: 420px; padding: 16px; }
.login-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 40px 36px; box-shadow: var(--shadow); }
.login-logo  { font-family: var(--serif); font-size: 24px; color: var(--accent); margin-bottom: 4px; }
.login-sub   { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 32px; }
.login-help  { font-size: 12px; color: var(--muted); text-align: center; margin-top: 20px; }
.login-help a { color: var(--accent); }

.tab-switch  { display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg); border-radius: 8px; padding: 4px; }
.tab-btn     { flex: 1; padding: 8px; background: none; border: none; border-radius: 6px; font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.tab-btn.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ── Layout ── */
.layout     { display: flex; min-height: 100vh; }
.sidebar    { width: 230px; background: var(--accent); flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.sidebar-logo-text { font-family: var(--serif); font-size: 18px; color: #fff; display: block; }
.sidebar-brand-name { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 4px; display: block; letter-spacing: 0.04em; }
.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-item    { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,0.75); text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.15s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #fff; }
.nav-icon    { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-logout { display: block; color: rgba(255,255,255,0.6); font-size: 12px; text-decoration: none; }
.sidebar-logout:hover { color: #fff; }

.main        { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar      { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

.page-content { padding: 28px; flex: 1; overflow-y: auto; }
.page-header  { margin-bottom: 24px; }
.page-title   { font-size: 20px; font-weight: 600; }
.page-sub     { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── Stat cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-value { font-size: 22px; font-weight: 600; }
.stat-delta { font-size: 11px; margin-top: 4px; color: var(--muted); }
.delta-up   { color: var(--success); }
.delta-dn   { color: var(--danger); }

/* ── Cards / tables ── */
.card        { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title  { font-size: 13px; font-weight: 600; }
.card-body   { padding: 20px; }

table.data   { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; }
table.data td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #faf9f7; }
.table-wrap  { overflow-x: auto; }

/* ── Forms ── */
.field-group  { margin-bottom: 18px; }
.field-label  { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.field-input, .field-select, .field-textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--font); font-size: 14px;
  background: var(--bg); color: var(--text); outline: none; transition: border-color 0.15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: var(--accent-mid); background: #fff; }
.field-textarea { min-height: 90px; resize: vertical; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.btn-primary:hover { background: var(--accent-mid); }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; background: none; font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.15s; }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-danger  { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--danger); color: #fff; border: none; border-radius: 8px; font-family: var(--font); font-size: 13px; cursor: pointer; text-decoration: none; transition: background 0.15s; }
.btn-danger:hover { background: #a93226; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn-full    { width: 100%; justify-content: center; }

/* ── Badges ── */
.badge       { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-amber { background: var(--warning-light); color: #b36200; }
.badge-red   { background: var(--danger-light);  color: var(--danger); }
.badge-gray  { background: #ECEFF1; color: #546E7A; }
.badge-blue  { background: var(--info-light);    color: var(--info); }
.badge-accent{ background: var(--accent-light);  color: var(--accent); }

/* ── Alerts ── */
.alert        { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; }
.alert-error  { background: var(--danger-light);  color: var(--danger); border: 1px solid #EF9A9A; }
.alert-success{ background: var(--success-light); color: var(--success); border: 1px solid #A5D6A7; }
.alert-info   { background: var(--info-light);    color: var(--info);    border: 1px solid #90CAF9; }
.alert-warning{ background: var(--warning-light); color: #7d4e00;        border: 1px solid #FFD54F; }

/* ── Upload zone ── */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--surface); }
.upload-zone:hover, .upload-zone.over { border-color: var(--accent-mid); background: var(--accent-light); }
.upload-zone .icon { font-size: 32px; margin-bottom: 10px; }
.upload-zone .title { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.upload-zone .sub { font-size: 12px; color: var(--muted); line-height: 1.7; }
.upload-zone .sub strong { color: var(--accent); }

/* ── Payout banner ── */
.payout-banner { background: var(--accent-light); border: 1px solid #C5DFA8; border-radius: var(--radius-lg); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.payout-amount { font-family: var(--serif); font-size: 30px; color: var(--accent); }
.payout-label  { font-size: 11px; color: var(--accent-mid); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.payout-note   { font-size: 12px; color: var(--accent-mid); margin-top: 4px; }

/* ── Store filter bar ── */
.filter-bar   { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .field-select { width: auto; padding: 7px 12px; font-size: 13px; }
.filter-bar .field-input  { width: 180px; padding: 7px 12px; font-size: 13px; }

/* ── Info box ── */
.info-box { background: var(--info-light); border: 1px solid #BBDEFB; border-radius: var(--radius); padding: 14px 16px; font-size: 12px; color: var(--info); line-height: 1.7; margin-bottom: 20px; }
.info-box strong { font-weight: 600; }
.info-box code { background: rgba(26,82,118,0.1); padding: 1px 5px; border-radius: 3px; }

/* ── Misc ── */
.text-muted  { color: var(--muted); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }

/* ── Responsive sidebar ── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .page-content { padding: 16px; }
}
