/* =========================================================
   LOVUS WORK — Stylesheet
   Palet warna diambil dari identitas LOVUS (lovus.id):
   - Emas utama   : #A9762F  (logo & aksen)
   - Emas gelap   : #7C551F  (hover / border)
   - Emas muda    : #D9B26A  (highlight lembut)
   - Krem latar   : #FAF6EE
   - Charcoal     : #2A241B  (teks utama)
   - Putih kartu  : #FFFFFF
   ========================================================= */

:root {
  --gold: #A9762F;
  --gold-dark: #7C551F;
  --gold-light: #D9B26A;
  --gold-pale: #F3E6CC;
  --cream: #FAF6EE;
  --charcoal: #2A241B;
  --muted: #7A7264;
  --white: #FFFFFF;
  --danger: #B3402A;
  --success: #3E7A4C;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(42, 36, 27, 0.06);
  --shadow-lg: 0 8px 28px rgba(42, 36, 27, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--charcoal);
  margin: 0 0 .4em;
  letter-spacing: .2px;
}

a { color: var(--gold-dark); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---------- LOGIN PAGE ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, #FFFDF8 0%, var(--cream) 55%, #F0E6D2 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  border-top: 3px solid var(--gold);
}
.login-card img.logo { width: 150px; margin-bottom: 18px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p.subtitle { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-card .field { text-align: left; margin-bottom: 16px; }

/* ---------- FORM ELEMENTS ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--charcoal); }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=file], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E4DAC4;
  border-radius: 8px;
  background: #FFFEFB;
  font-size: 14px;
  color: var(--charcoal);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 118, 47, .15);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .05s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--gold); color: var(--gold-dark); }
.btn-outline:hover { background: var(--gold-pale); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f3320; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- LAYOUT (Sidebar + Content) ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #241E15 0%, #2A241B 100%);
  color: #EDE4D0;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; padding: 0 8px; }
.sidebar .brand img { width: 40px; }
.sidebar .brand span { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold-light); letter-spacing: .5px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #C9BEA4;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 4px;
  font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--gold); color: #fff; }
.sidebar .user-box {
  margin-top: 24px;
  padding: 14px;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  font-size: 13px;
}
.sidebar .user-box .name { color: #fff; font-weight: 600; display:block; margin-bottom:2px; }
.sidebar .user-box .role { color: var(--gold-light); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.sidebar .logout-link { display:block; margin-top:10px; font-size:12.5px; color:#C9836B; }

.main { padding: 28px 34px; max-width: 1400px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.topbar h1 { font-size: 24px; }
.topbar .meta { color: var(--muted); font-size: 13px; }

/* ---------- CARDS / STAT GRID ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #F0E8D6;
}
.stat-card .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--charcoal); margin-top: 6px; font-family: 'Playfair Display', serif; }
.stat-card .sub { font-size: 12px; color: var(--gold-dark); margin-top: 4px; }
.stat-card .icon { font-size: 22px; margin-bottom: 8px; }

.section-title { display:flex; align-items:center; justify-content:space-between; margin: 30px 0 14px; }
.section-title h2 { font-size: 17px; }

/* ---------- TABLE ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #F0E8D6; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; }
thead th { background: var(--gold-pale); color: var(--gold-dark); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; position: sticky; top: 0; }
tbody tr { border-top: 1px solid #F2ECDD; }
tbody tr:hover { background: #FCF9F1; }
.badge { display:inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-tiktok { background: #E6E6E6; color: #111; }
.badge-shopee { background: #FFE5D1; color: #C1440E; }
.badge-gold { background: var(--gold-pale); color: var(--gold-dark); }

/* ---------- PROGRESS BAR (KPI) ---------- */
.progress { background: #F0E8D6; border-radius: 20px; height: 10px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); border-radius: 20px; }
.progress.over > div { background: linear-gradient(90deg, #3E7A4C, #5FA46F); }

/* ---------- FLASH ALERT ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #E9F3EA; color: var(--success); border: 1px solid #C7E2CA; }
.alert-error { background: #FBEAE6; color: var(--danger); border: 1px solid #F0C9C0; }

/* ---------- MODAL / FORM PAGE ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { margin-top: 22px; display:flex; gap: 10px; }

.profile-photo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold-pale); }

.filter-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; align-items:end; }
.filter-bar .field { min-width: 150px; }

.pill-nav { display:flex; gap:8px; margin-bottom: 20px; flex-wrap:wrap; }
.pill-nav a { padding:7px 16px; border-radius: 20px; background:#fff; border:1px solid #E8DCC0; font-size:13px; font-weight:600; color:var(--charcoal); }
.pill-nav a.active { background: var(--gold); color:#fff; border-color: var(--gold); }

.empty-state { text-align:center; padding: 50px 20px; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* Mobile sidebar toggle */
.mobile-topbar { display:none; }
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display:none; }
  .sidebar.open { display:block; position:fixed; z-index:50; width:240px; }
  .mobile-topbar {
    display:flex; align-items:center; justify-content:space-between;
    background:#241E15; color:#fff; padding:14px 18px;
  }
  .mobile-topbar img { width:34px; }
  .mobile-topbar button { background:none; border:none; color:#fff; font-size:22px; cursor:pointer; }
  .main { padding: 20px; }
}
