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

:root {
  --cream: #FAF8F5;
  --dark: #1A1A18;
  --gold: #C9A84C;
  --gold-light: #F0E6C8;
  --gold-muted: #E8D5A3;
  --surface: #FFFFFF;
  --surface2: #F5F3EF;
  --border: rgba(201,168,76,0.2);
  --border-strong: rgba(201,168,76,0.45);
  --text-primary: #1A1A18;
  --text-secondary: #6B6860;
  --text-muted: #A8A49C;
  --danger: #C0392B;
  --success: #2E7D5E;
  --radius: 4px;
  --radius-lg: 10px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.brand {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 18px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.brand-sub {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-section {
  padding: 1.25rem 1rem;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.5);
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 2px;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 400;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
}

.nav-item:hover {
  background: rgba(201,168,76,0.08);
  color: rgba(255,255,255,0.85);
  border-color: rgba(201,168,76,0.15);
}

.nav-item.active {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  border-color: rgba(201,168,76,0.25);
}

/* MAIN */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.badge-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #EAF5EE;
  color: var(--success);
  border: 1px solid rgba(46,125,94,0.2);
  font-weight: 500;
}

.content {
  flex: 1;
  padding: 2rem;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
  opacity: 0.6;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

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

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

table { width: 100%; border-collapse: collapse; }

thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

th {
  text-align: left;
  padding: 0.75rem 1.5rem;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

td {
  padding: 1rem 1.5rem;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(201,168,76,0.08);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,168,76,0.03); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dark);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #2a2a26;
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,168,76,0.2);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text-primary);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(192,57,43,0.25);
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #FDF0EE;
  border-color: var(--danger);
  transform: translateY(-1px);
}

.actions { display: flex; gap: 6px; }

/* FORMULARIOS */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--gold);
  background: var(--surface);
}

.form-footer {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* AVATAR */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-light);
  border: 1px solid var(--gold-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: #8B6914;
  margin-right: 8px;
  vertical-align: middle;
}

/* STOCK BAR */
.stock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-track {
  width: 60px; height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.stock-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
}

.stock-fill.low { background: var(--danger); }
.stock-num { font-size: 12px; color: var(--text-secondary); }

/* BADGE */
.badge-active {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #EAF5EE;
  color: var(--success);
  border: 1px solid rgba(46,125,94,0.2);
}

.badge-returned {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}