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

:root {
  --primary: oklch(0.35 0.12 340);          /* Deep Plum */
  --primary-light: oklch(0.45 0.14 340);
  --primary-dark: oklch(0.22 0.08 340);
  --accent: oklch(0.72 0.11 35);            /* Gold/Bronze */
  --bg-main: oklch(0.96 0.01 40);           /* Slate background */
  --white: oklch(1 0 0);
  --text-main: oklch(0.18 0.01 40);
  --text-light: oklch(0.45 0.01 40);
  --success: oklch(0.65 0.14 140);
  --info: oklch(0.6 0.12 220);
  --warning: oklch(0.75 0.15 70);
  --danger: oklch(0.55 0.18 20);
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-sans: 'Plus Jakarta Sans', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  opacity: 0.9;
}

/* ==================== AUTH SCREEN ==================== */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top left, var(--primary-dark), #1c060d);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.auth-card {
  background-color: var(--white);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.auth-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(94, 25, 45, 0.08);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-card h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.auth-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  background-color: var(--white);
  transition: var(--transition-smooth);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 25, 45, 0.08);
}

.pin-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 15px;
}

.pin-hint strong {
  color: var(--primary);
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.sidebar-header .logo span {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.badge-admin {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-menu {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.menu-item {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.menu-item:hover,
.menu-item.active {
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.08);
}

.menu-item.active {
  border-left: 3px solid var(--accent);
}

.count-badge {
  background-color: var(--danger);
  color: var(--white);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: auto;
}

/* Main Content area */
.main-content {
  padding: 40px;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 15px;
}

.top-bar h1 {
  font-size: 1.8rem;
  color: var(--primary-dark);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-profile .avatar {
  width: 36px;
  height: 36px;
  background-color: var(--accent);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-profile .name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background-color: var(--white);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.apt { background-color: rgba(94, 25, 45, 0.08); color: var(--primary); }
.stat-icon.pending { background-color: rgba(245, 158, 11, 0.08); color: var(--warning); }
.stat-icon.items { background-color: rgba(59, 130, 246, 0.08); color: var(--info); }
.stat-icon.inq { background-color: rgba(16, 185, 129, 0.08); color: var(--success); }

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Cards & tables */
.card {
  background-color: var(--white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
  margin-bottom: 30px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table th {
  background-color: rgba(0, 0, 0, 0.01);
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background-color: rgba(94, 25, 45, 0.01);
}

/* Badges */
.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-badge.pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-badge.confirmed { background-color: rgba(59, 130, 246, 0.1); color: var(--info); }
.status-badge.completed { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-badge.cancelled { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

.status-badge.available { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-badge.unavailable { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Inventory Grid Split */
.inventory-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 30px;
  align-items: flex-start;
}

.form-btns {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

/* ==================== DETAIL DRAWER ==================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 100%;
  height: 100%;
  background-color: var(--white);
  z-index: 1060;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 24px 30px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
}

.btn-close-drawer {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-light);
}

.drawer-body {
  padding: 30px;
  flex-grow: 1;
  overflow-y: auto;
}

/* Detail UI elements inside Drawer */
.detail-section {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 16px;
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h4 {
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item span:first-child {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
}

.detail-item span:last-child {
  font-weight: 600;
  font-size: 0.95rem;
}

.measurements-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.measurement-badge-item {
  background-color: var(--bg-main);
  padding: 10px;
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.measurement-badge-item span {
  display: block;
}

.measurement-badge-item span:first-child {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.measurement-badge-item span:last-child {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Responsive design */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 20px;
  }
  .sidebar-menu {
    flex-direction: row;
    margin-top: 0;
    gap: 8px;
  }
  .menu-item {
    padding: 8px 12px;
    width: auto;
  }
  .sidebar-footer {
    display: none;
  }
  .inventory-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px;
  }
  .sidebar-menu {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
  }
  .sidebar {
    flex-direction: column;
    align-items: flex-start;
  }
}
