/* RS Platform — Shared Cabinet CSS */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --forest: #0D503C;
  --green: #10B981;
  --green-light: #D1FAE5;
  --blue: #2563EB;
  --blue-light: #DBEAFE;
  --gold: #F59E0B;
  --gold-light: #FEF3C7;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --charcoal: #1A1A2E;
  --bg: #F8FAFB;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --text: #1A1A2E;
  --text2: #4B5563;
  --text3: #9CA3AF;
  --sidebar-w: 240px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.08);
}

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

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
}

.sidebar-subtitle {
  font-size: 10px;
  color: var(--text3);
}

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

.nav-group {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 12px 12px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all .15s;
  text-decoration: none;
}

.nav-item:hover { background: rgba(16,185,129,.06); }
.nav-item.active {
  background: rgba(16,185,129,.1);
  color: var(--forest);
  font-weight: 500;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: 12px; font-weight: 600; }
.user-role { font-size: 10px; color: var(--green); text-transform: uppercase; }

.sidebar-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sidebar-actions a {
  font-size: 11px;
  color: var(--text3);
  text-decoration: none;
}
.sidebar-actions a:hover { color: var(--text); }
.sidebar-actions a.danger { color: var(--red); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 20px;
  min-height: 100vh;
  overflow-y: auto;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: var(--bg); }

.btn-primary {
  background: linear-gradient(135deg, var(--forest), var(--green));
  color: #fff;
  border: none;
  font-weight: 600;
}
.btn-primary:hover { opacity: .9; }

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 16px 18px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover { background: rgba(16,185,129,.02); }

/* ===== FORMS ===== */
input, select, textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border .2s;
  background: var(--surface);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
}

label {
  font-size: 11px;
  color: var(--text2);
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  width: 500px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 { margin-bottom: 16px; font-size: 16px; }

/* ===== BADGES ===== */
.badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-block;
}

.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--forest); }
.badge-gold { background: var(--gold-light); color: #92400E; }
.badge-red { background: var(--red-light); color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text3);
}

.empty-state .icon { font-size: 36px; margin-bottom: 12px; }
.empty-state .title { font-size: 14px; font-weight: 500; color: var(--text); }
.empty-state .desc { font-size: 12px; margin-top: 4px; }

/* ===== LOGIN ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F0FDF4, var(--bg), #EFF6FF);
}

.login-box {
  width: 400px;
  max-width: 90%;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--forest), var(--green));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #A7F3D0;
  font-weight: 800;
  font-size: 16px;
}

.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-desc { font-size: 13px; color: var(--text2); margin-bottom: 24px; }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ===== UTILS ===== */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text3); }
.text-sm { font-size: 11px; }
.text-xs { font-size: 10px; }
.font-bold { font-weight: 600; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
