/* AGOC Panel — Professional Dark Luxury Theme */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --gold:       #D4AF37;
  --gold-light: #F0D060;
  --gold-dim:   #8a7020;
  --bg:         #080808;
  --bg2:        #101010;
  --bg3:        #161616;
  --bg4:        #1e1e1e;
  --border:     #2a2a2a;
  --border2:    #333333;
  --text:       #e8e8e8;
  --text2:      #999999;
  --text3:      #555555;
  --success:    #2ecc71;
  --warning:    #f39c12;
  --danger:     #e74c3c;
  --info:       #3498db;
  --radius:     8px;
  --radius-lg:  14px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold:0 0 30px rgba(212,175,55,0.12);
  --transition: 0.2s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ── Layout ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-size: 0.65rem;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section-label {
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }

.nav-item.active {
  color: var(--gold);
  background: rgba(212,175,55,0.07);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text3);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-user .avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bg);
  flex-shrink: 0;
}

.sidebar-user .user-info .user-name { color: var(--text); font-size: 0.8rem; font-weight: 500; }
.sidebar-user .user-info .user-role { color: var(--text3); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; }

/* ── Main Content ── */
.main-content {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-date { font-size: 0.75rem; color: var(--text3); }

.topbar-alert-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text2);
}

.topbar-alert-btn:hover { border-color: var(--gold); color: var(--gold); }

.alert-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1px solid var(--bg2);
}

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

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left .page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.page-header-left .page-subtitle { font-size: 0.8rem; color: var(--text3); margin-top: 4px; }

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 22px; }
.card-body.p0 { padding: 0; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}

.stat-card:hover { border-color: var(--border2); }

.stat-card.gold-accent { border-color: rgba(212,175,55,0.3); }
.stat-card.gold-accent::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.stat-label { font-size: 0.7rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-unit { font-size: 0.75rem; color: var(--text2); margin-top: 4px; }
.stat-change { font-size: 0.72rem; color: var(--success); margin-top: 6px; }
.stat-change.down { color: var(--danger); }
.stat-icon { position: absolute; top: 20px; right: 20px; font-size: 1.8rem; opacity: 0.12; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background var(--transition); }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child { border-bottom: none; }

tbody td { padding: 13px 16px; color: var(--text2); vertical-align: middle; }
tbody td strong { color: var(--text); font-weight: 500; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-success { background: rgba(46,204,113,0.15); color: var(--success); border: 1px solid rgba(46,204,113,0.3); }
.btn-success:hover { background: rgba(46,204,113,0.25); }

.btn-danger { background: rgba(231,76,60,0.15); color: var(--danger); border: 1px solid rgba(231,76,60,0.3); }
.btn-danger:hover { background: rgba(231,76,60,0.25); }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-lg { padding: 13px 28px; font-size: 0.9rem; }
.btn-xl { padding: 18px 36px; font-size: 1rem; border-radius: var(--radius-lg); }

/* ── Labour Big Buttons ── */
.labour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.labour-btn {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text);
}

.labour-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.05);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.labour-btn .lb-icon {
  width: 64px; height: 64px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}

.labour-btn .lb-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.labour-btn .lb-desc { font-size: 0.78rem; color: var(--text3); line-height: 1.5; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.87rem;
  transition: border-color var(--transition);
  appearance: none;
}

.form-control:focus { outline: none; border-color: var(--gold); background: var(--bg4); }
.form-control::placeholder { color: var(--text3); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-control.big {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  height: auto;
}

.form-row { display: grid; gap: 16px; }
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint { font-size: 0.7rem; color: var(--text3); margin-top: 5px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-warning    { background: rgba(243,156,18,0.15); color: #f39c12; border: 1px solid rgba(243,156,18,0.3); }
.badge-info       { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid rgba(52,152,219,0.3); }
.badge-success    { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.badge-danger     { background: rgba(231,76,60,0.15);  color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.badge-dispatched { background: rgba(155,89,182,0.15); color: #9b59b6; border: 1px solid rgba(155,89,182,0.3); }
.badge-secondary  { background: rgba(255,255,255,0.07); color: var(--text2); border: 1px solid var(--border); }
.badge-urgent     { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.badge-normal     { background: rgba(255,255,255,0.05); color: var(--text3); border: 1px solid var(--border); }

/* ── Alerts ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.83rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid;
}

.alert-success { background: rgba(46,204,113,0.08);  border-color: var(--success); color: #5ddb91; }
.alert-danger  { background: rgba(231,76,60,0.08);   border-color: var(--danger);  color: #f07267; }
.alert-warning { background: rgba(243,156,18,0.08);  border-color: var(--warning); color: #f7b731; }
.alert-info    { background: rgba(52,152,219,0.08);  border-color: var(--info);    color: #5dade2; }

/* ── Progress ── */
.progress { height: 5px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.6s ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.danger  { background: var(--danger); }

/* ── Stock indicator ── */
.stock-low   { color: var(--danger); }
.stock-ok    { color: var(--success); }
.stock-warn  { color: var(--warning); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }

.toast {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.83rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 380px;
}

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Grid utilities ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Search bar ── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-bar input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 0.83rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color var(--transition);
}

.search-bar input:focus { outline: none; border-color: var(--gold); }
.search-bar .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 0.9rem; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.88rem; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(212,175,55,0.05) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(212,175,55,0.03) 0%, transparent 50%);
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 52px 48px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 6px;
  display: block;
  line-height: 1;
}

.login-logo .sub {
  font-size: 0.65rem;
  color: var(--text3);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span { font-size: 0.65rem; color: var(--text3); letter-spacing: 2px; text-transform: uppercase; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .labour-grid { grid-template-columns: 1fr; }
  .login-box { padding: 36px 24px; }
}

/* ── Utility ── */
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text3); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-bold { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
