/* ===================================================
   Office Comb — Shared CSS
   =================================================== */

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

/* ---------- CSS Variables ---------- */
:root {
  --bg-color: #0f172a;
  --surface-color: rgba(30, 41, 59, 0.7);
  --surface-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #f59e0b, #d97706);
  --accent-hover: linear-gradient(135deg, #d97706, #b45309);
  --error-color: #ef4444;
  --success-color: #22c55e;
  --radius: 12px;
  --transition: all 0.3s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-color); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.85; }

/* ---------- Animations ---------- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Glass Card ---------- */
.glass-card {
  width: 100%;
  max-width: 450px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 2.5rem 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: slideUp 0.4s ease both;
}

/* ---------- Center Wrapper ---------- */
.center-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
}

.form-control::placeholder { color: rgba(148, 163, 184, 0.5); }
.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-control { resize: vertical; min-height: 90px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #0f172a;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
}
.btn-outline:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }

/* ---------- Alerts ---------- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error-color); }
.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success-color); }

/* ---------- Dashboard Layout ---------- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 1rem;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0.25rem;
  line-height: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(245, 158, 11, 0.07);
  border-left-color: rgba(245, 158, 11, 0.4);
}

.nav-item.active {
  color: var(--accent-color);
  background: rgba(245, 158, 11, 0.1);
  border-left-color: var(--accent-color);
}

.nav-item.logout-btn {
  margin-top: auto;
  color: var(--error-color);
}
.nav-item.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--error-color);
}

.nav-spacer { flex: 1; }

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  padding: 2rem 3rem;
  overflow-x: hidden;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--surface-border);
}

.topbar-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile-info { text-align: right; }
.user-profile-info .name  { font-size: 0.875rem; font-weight: 600; }
.user-profile-info .email { font-size: 0.75rem; color: var(--text-secondary); }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  flex-shrink: 0;
}

/* ---------- Hamburger Menu Toggle ---------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  margin-right: 0.75rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Sidebar Overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  animation: fadeIn 0.2s ease;
}
.sidebar-overlay.active { display: block; }

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ---------- Tabs ---------- */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

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

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

tbody td {
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active   { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.badge-inactive { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

/* ---------- Services Grid ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.service-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.service-card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.service-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Info Row ---------- */
.info-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.info-item {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  flex: 1;
  min-width: 160px;
}

.info-item-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.info-item-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Activity ---------- */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 0.875rem 1rem;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-color);
  flex-shrink: 0;
}

.activity-text  { font-size: 0.875rem; }
.activity-time  { font-size: 0.75rem; color: var(--text-secondary); margin-left: auto; white-space: nowrap; }

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  padding: 1rem;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.2s ease; }

.modal-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  backdrop-filter: blur(16px);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title { font-size: 1.125rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text-primary); }

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

.search-input-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input-wrap .form-control { padding-left: 2.5rem; }

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--surface-border);
  margin: 1.25rem 0;
}

/* ---------- Utilities ---------- */
.hidden           { display: none !important; }
.flex             { display: flex; }
.justify-between  { justify-content: space-between; }
.items-center     { align-items: center; }
.gap-4            { gap: 1rem; }
.text-sm          { font-size: 0.875rem; }
.text-xs          { font-size: 0.75rem; }
.text-accent      { color: var(--accent-color); }
.text-secondary   { color: var(--text-secondary); }
.text-center      { text-align: center; }
.mt-4             { margin-top: 1rem; }
.mt-6             { margin-top: 1.5rem; }
.mb-2             { margin-bottom: 0.5rem; }
.mb-4             { margin-bottom: 1rem; }
.mb-6             { margin-bottom: 1.5rem; }
.font-semibold    { font-weight: 600; }
.overflow-x-auto  { overflow-x: auto; }

/* ---------- Form Row ---------- */
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* ===================================================
   RESPONSIVE
   =================================================== */

/* ---- ≤768px ---- */
@media (max-width: 768px) {
  /* Hamburger visible */
  .menu-toggle { display: flex; }

  /* Sidebar becomes a fixed off-canvas drawer */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }

  /* Show close button inside sidebar */
  .sidebar-close { display: block; }

  /* Sidebar brand row: brand + close side by side */
  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-text-fill-color: unset;
    color: transparent;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
  }

  /* Main content fills full width */
  .main-content { padding: 1.25rem 1rem; }

  /* Stats grid: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Topbar */
  .topbar { margin-bottom: 1.25rem; }
  .topbar-title { font-size: 1.125rem; }

  /* User profile email hidden on small screens */
  .user-profile-info .email { display: none; }
}

/* ---- ≤480px ---- */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row   { flex-direction: column; }
  .glass-card { padding: 1.75rem 1.25rem; }

  /* Modal bottom sheet on small screens */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-width: 100%;
  }

  .info-row { gap: 0.75rem; }
}
