/**
 * Commercial360 - Modern Premium UI
 */

:root {
  --brand: #0f519a;
  --brand-dark: #0a3d73;
  --brand-light: #3b82f6;
  --accent: #06b6d4;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
}

body {
  font-family: 'Plus Jakarta Sans', 'Lato', -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  background: var(--surface-3);
  min-height: 100vh;
}

/* ========== DARK SIDEBAR ========== */
.sidebar,
.js-sidebar,
.nav.js-nav {
  background: var(--sidebar-bg) !important;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15) !important;
  border-right: none !important;
}

.nav__link,
.nav__link .nav__title,
.nav__link .nav__preview {
  color: var(--sidebar-text) !important;
}

.nav__link {
  margin: 4px 10px !important;
  padding: 0.75rem 1rem !important;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav__link:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-text-active) !important;
}

.nav__link:hover .nav__title,
.nav__link:hover .nav__preview i {
  color: var(--sidebar-text-active) !important;
}

.nav__link.active,
.nav__link.active .nav__preview,
.nav__link.active .nav__title {
  background: var(--sidebar-active) !important;
  color: var(--sidebar-text-active) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav__link.active .nav__preview i {
  color: var(--sidebar-text-active) !important;
}

.nav__link_head {
  padding: 1.25rem 1rem !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  margin-bottom: 0.5rem;
}

.nav__link_head .nav__pic,
.nav__link_head .nav__title {
  filter: brightness(0) invert(1);
}

#clientDropdown,
#clientDropdownMobile {
  background: var(--sidebar-hover) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: var(--sidebar-text) !important;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 10px;
}

.arrow-toggle {
  background: var(--sidebar-active) !important;
  box-shadow: 0 2px 12px rgba(59,130,246,0.5) !important;
}

.menu-button {
  background: var(--sidebar-bg) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ========== TOP BAR ========== */
.container__head {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
}

.container__title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.03em;
}

#user-select-div select,
#user-select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  min-width: 180px;
}

/* ========== MAIN CONTENT ========== */
.container__body {
  padding: 1.5rem;
}

.panel, .js-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2rem;
}

/* ========== AUTOPILOT PAGE ========== */
.autopilot-page .section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.autopilot-page .section:first-child {
  background: linear-gradient(135deg, #1d4ed8 0%, var(--brand) 35%, var(--brand-dark) 100%);
  border: none;
  color: #fff;
  padding: 2rem 2.5rem;
  box-shadow: 0 4px 14px rgba(15, 81, 154, 0.35);
}

.autopilot-page .section:first-child h2 {
  color: #fff;
  font-size: 1.625rem;
  font-weight: 700;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.autopilot-page .section:first-child p {
  color: rgba(255,255,255,0.92);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.autopilot-page .section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--brand-light);
}

.autopilot-page .section p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.autopilot-page .section + .section {
  margin-top: 0;
}

.autopilot-page .form-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.autopilot-page .form-group label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  flex: 1;
  min-width: 220px;
}

.autopilot-page .form-group input,
.autopilot-page .form-group select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  min-width: 140px;
}

.autopilot-page .form-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,81,154,0.2);
  outline: none;
}

/* Toggles */
.autopilot-page .switch {
  width: 56px;
  height: 30px;
}

.autopilot-page .switch .slider {
  border-radius: 30px;
  background: #cbd5e1;
}

.autopilot-page .switch .slider:before {
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.autopilot-page .switch input:checked + .slider {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%) !important;
}

.autopilot-page .switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* Day checkboxes - pill style */
.autopilot-page .day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.autopilot-page .day-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-width: 4rem;
}

.autopilot-page .day-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.autopilot-page .day-checkbox::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: #fff;
  margin-right: 0.5rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.autopilot-page .day-checkbox:has(input:checked)::before {
  background: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.autopilot-page .day-checkbox:hover {
  border-color: var(--brand-light);
  background: #eff6ff;
}

.autopilot-page .day-checkbox:has(input:checked) {
  border-color: var(--brand);
  background: #eff6ff;
  color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-light);
}

.autopilot-page .form-group:has(.day-checkboxes) {
  flex-direction: column;
  align-items: flex-start;
}

.autopilot-page .form-group.hours-row {
  flex-direction: row;
  gap: 2rem;
}

.autopilot-page .form-group-inline {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.autopilot-page .form-group-inline input[type="time"] {
  max-width: 150px;
}

/* Cap & Pause sections */
.cap-settings .form-group,
.pause-settings .form-group {
  flex-direction: column;
  align-items: flex-start;
}

.cap-settings input,
.pause-settings input {
  max-width: 200px;
}

/* Global overrides */
.section {
  max-width: 100%;
}

.form-group input,
.form-group select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

.btn-primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}

.btn-primary:hover {
  background: var(--brand-dark) !important;
}
