/* -------------------------------------------------------------
 * DockLink CSS Design System - Dark Glassmorphism Theme
 * ----------------------------------------------------------- */

:root {
  --bg-dark: #07070b;
  --panel-bg: rgba(22, 22, 33, 0.55);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(255, 255, 255, 0.2);
  
  --primary: #8a2be2;
  --primary-glow: rgba(138, 43, 226, 0.4);
  --secondary: #00bfff;
  --secondary-glow: rgba(0, 191, 255, 0.4);
  
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b5;
  --text-muted: #6b6b7d;
  
  --success: #00fa9a;
  --warning: #ffd700;
  --danger: #ff4500;
  
  --font-family: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Glowing Gradients */
.glow-mesh-1 {
  position: fixed;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}
.glow-mesh-2 {
  position: fixed;
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

/* Glass Card Definition */
.glass-card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition);
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Typography elements */
span.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}
span.logo span {
  color: var(--secondary);
}

h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
p.description-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a020f0 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glass-active);
}
.btn-logout {
  background: rgba(255, 69, 0, 0.1);
  color: #ff6b4a;
  border: 1px solid rgba(255, 69, 0, 0.2);
}
.btn-logout:hover {
  background: rgba(255, 69, 0, 0.25);
  border-color: rgba(255, 69, 0, 0.4);
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

/* Icon details */
.icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Forms input designs */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition);
}
select option {
  background-color: #12121c;
  color: #fff;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
  background: rgba(255, 255, 255, 0.06);
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group {
  flex: 1;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-group input {
  width: auto;
}
.checkbox-group label {
  text-transform: none;
  font-size: 13px;
  margin-bottom: 0;
  cursor: pointer;
}
.margin-top {
  margin-top: 16px;
}
.align-end {
  align-self: flex-end;
}

/* Helper hidden */
.hidden {
  display: none !important;
}

/* AUTHENTICATION LAYOUT */
.auth-panel {
  max-width: 420px;
  margin: 10vh auto;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.5s ease-out;
}
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 8px;
}
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.auth-tabs button.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.carrier-portal-hint {
  border-top: 1px solid var(--border-glass);
  margin-top: 24px;
  padding-top: 20px;
  text-align: center;
}
.carrier-portal-hint p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

/* Sidebar styling */
.sidebar {
  width: 260px;
  background: rgba(12, 12, 18, 0.8);
  border-right: 1px solid var(--border-glass);
  padding: 24px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}
.sidebar-header {
  margin-bottom: 40px;
}
.tenant-tag {
  display: inline-block;
  background: var(--primary-glow);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.menu-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: var(--transition);
}
.menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  padding-left: 20px;
}
.menu-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.menu-item .icon {
  width: 18px;
  height: 18px;
}
.sidebar-footer {
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.user-info .email {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-info .role {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Main Content Styling */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.content-header {
  height: 70px;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(5px);
  background: rgba(7, 7, 11, 0.4);
}
.header-search {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-search label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.header-search select {
  width: 220px;
}
.header-actions {
  display: flex;
  gap: 12px;
}

.content-section {
  padding: 40px;
  flex: 1;
  animation: fadeIn 0.4s ease-out;
}
.section-title {
  margin-bottom: 30px;
}
.section-title p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* VIEW 1: DASHBOARD METRICS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.icon-purple {
  background: rgba(138, 43, 226, 0.1);
  color: var(--primary);
}
.icon-emerald {
  background: rgba(0, 250, 154, 0.1);
  color: var(--success);
}
.icon-blue {
  background: rgba(0, 191, 255, 0.1);
  color: var(--secondary);
}
.stat-details .label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-details h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
}
.stat-details .subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

/* Circle Util Chart */
.util-chart-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gauge-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 20px 0;
}
.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring__circle {
  transition: stroke-dashoffset 0.5s ease-out;
  stroke-linecap: round;
}
.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}
.chart-caption {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Tables styling */
.table-panel {
  overflow: hidden;
}
.table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}
.text-center {
  text-align: center;
}

/* VIEW 2: CALENDAR DOOR GRID */
.calendar-controls {
  margin-bottom: 24px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.swatch.pickup, .badge.pickup {
  background: rgba(138, 43, 226, 0.25);
  border: 1px solid var(--primary);
  color: #d1b3ff;
}
.swatch.delivery, .badge.delivery {
  background: rgba(0, 191, 255, 0.25);
  border: 1px solid var(--secondary);
  color: #b3ecff;
}
.swatch.blocked, .badge.blocked {
  background: rgba(255, 69, 0, 0.2);
  border: 1px solid var(--danger);
  color: #ffb399;
}
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.calendar-wrapper {
  display: flex;
  height: 600px;
  overflow: hidden;
  padding: 0;
  position: relative;
}
.time-axis {
  width: 80px;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.1);
  user-select: none;
  padding-top: 60px; /* offset header height */
  overflow: hidden;
}
.hour-marker {
  height: 60px; /* 1 hour = 60px */
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px dashed rgba(255,255,255,0.02);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}

.grid-columns-container {
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: auto;
}
.door-column {
  flex: 1;
  min-width: 180px;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: relative;
}
.door-header {
  height: 60px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.01);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(5px);
}
.door-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.door-header span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.door-body-grid {
  flex: 1;
  height: 540px; /* 9 hours * 60px */
  position: relative;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 60px; /* Grid lines every hour */
  cursor: cell;
}

/* Appointment block elements */
.apt-card {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.apt-card:hover {
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.apt-card.pickup {
  background: rgba(138, 43, 226, 0.15);
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  color: #fff;
}
.apt-card.delivery {
  background: rgba(0, 191, 255, 0.15);
  border: 1px solid var(--secondary);
  border-left: 4px solid var(--secondary);
  color: #fff;
}
.apt-card.blocked {
  background: rgba(255, 69, 0, 0.12);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  color: #ffccc0;
}
.apt-time {
  font-weight: 700;
  font-size: 10px;
  opacity: 0.85;
}
.apt-carrier {
  font-weight: 700;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apt-ref {
  font-size: 10px;
  color: var(--text-secondary);
}

/* VIEW 3: CONFIG PANEL */
.facilities-panels {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}
.panel-left {
  align-self: start;
}
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-header h3 {
  margin-bottom: 0;
}
.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.list-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.list-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-glass-active);
}
.list-item.active {
  background: var(--primary-glow);
  border-color: var(--primary);
}
.list-item h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.list-item p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.config-block h3 {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
}

/* Hours grid rows */
.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.hours-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.01);
  padding: 8px 16px;
  border-radius: 8px;
}
.day-check {
  width: 140px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.hours-row input[type="time"] {
  width: 120px;
}
.hours-row span {
  color: var(--text-muted);
}

/* exceptions block */
.exceptions-block {
  margin-top: 20px;
}

/* VIEW 4: API INTEGRATION */
.api-integration-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}
.api-key-container {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.1);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  margin-top: 16px;
}
.api-key-container input {
  background: transparent;
  border: none;
  font-family: monospace;
  font-size: 14px;
  flex: 1;
}
.api-key-container input:focus {
  box-shadow: none;
  border-color: transparent;
}
.code-documentation-panel pre {
  background: #0d0e14;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  color: #ff79c6;
  margin-top: 16px;
}
.code-documentation-panel code {
  font-family: monospace;
}

/* CARRIER PORTAL LAYOUT Overlay */
.carrier-portal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 7, 11, 0.95);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease-out;
}
.carrier-portal-card {
  width: 480px;
}
.portal-header {
  text-align: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}
.portal-header h3 {
  margin-top: 8px;
  margin-bottom: 4px;
}
.portal-header p {
  font-size: 12px;
  color: var(--text-secondary);
}
.card-summary {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.card-summary h4 {
  font-size: 14px;
  color: #fff;
}
.card-summary p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.hidden-box {
  border-top: 1px dashed var(--border-glass);
  margin-top: 12px;
  padding-top: 12px;
}

/* NATIVE DIALOG MODALS styling */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  border: 1px solid var(--border-glass-active);
  box-shadow: 0 15px 50px rgba(0,0,0,0.8);
  z-index: 200;
}
.modal::backdrop {
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(10px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}
.modal-close:hover {
  color: #fff;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hidden-box.hidden {
  display: none !important;
}
