/* DESIGN SYSTEM & CONFIGURATION - PREMIUM LIGHT THEME */
:root {
  --bg-primary: #f8fafc;        /* Slate 50 - Fresh, modern light backdrop */
  --bg-secondary: #ffffff;      /* Pure white container surface */
  --bg-card: #ffffff;           /* Clean white card background */
  --border-color: #e2e8f0;      /* Slate 200 - Soft crisp border */
  --border-focus: #3b82f6;      /* Blue focus outline */
  
  --text-primary: #0f172a;     /* Slate 900 - Crisp readable dark text */
  --text-secondary: #475569;   /* Slate 600 - Secondary text */
  --text-muted: #64748b;       /* Slate 500 - Muted labels */
  
  --color-accent: #2563eb;       /* Royal Blue */
  --color-accent-hover: #1d4ed8;
  --color-success: #10b981;      /* Emerald Green */
  --color-success-hover: #059669;
  --color-danger: #ef4444;       /* Rose Red */
  --color-warning: #f59e0b;      /* Amber Yellow */
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px 0 rgba(37, 99, 235, 0.12);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

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

code {
  font-family: monospace;
  background-color: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  color: #d97706;
  font-size: 0.9em;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.p-3 { padding: 0.75rem; }
.d-block { display: block; }
.max-w-lg { max-width: 500px !important; }

/* UTILITY CLASSES */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
}

/* BUTTONS */
button, .btn {
  font-family: var(--font-sans);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35) !important;
}
.btn-success:hover {
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.45) !important;
}

.btn-accent {
  background-color: var(--color-accent);
  color: #ffffff;
}
.btn-accent:hover {
  background-color: var(--color-accent-hover);
}

.btn-outline {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-outline-sm {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}
.btn-outline-sm:hover {
  background-color: #f8fafc;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-block {
  width: 100%;
}

/* FORM ELEMENTS */
.input-group, .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label, .form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
select:focus,
.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
}

input::placeholder {
  color: #94a3b8;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* LOGIN SCREEN */
#login-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.06) 0%, transparent 45%),
              radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 45%),
              #f8fafc;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.login-card .brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card .brand-logo {
  margin-bottom: 0.75rem;
}

.login-card .brand-logo .nav-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 2rem;
  margin: 0 auto;
}

.login-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.login-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.error-msg {
  color: var(--color-danger);
  font-size: 0.85rem;
}

/* NAVBAR */
#dashboard-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
#dashboard-screen.active {
  display: flex;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.25rem 1.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  z-index: 10;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 600;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1877f2 0%, #2563eb 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 3px 10px rgba(24, 119, 242, 0.3);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.4rem;
}

.nav-btn {
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.nav-btn.active {
  color: var(--color-accent);
  background-color: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

#user-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

/* DASHBOARD MAIN CONTENT */
.content-container {
  flex: 1;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.tab-content.active {
  display: flex;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.panel {
  padding: 1.75rem;
  border-radius: var(--radius-md);
  height: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
}

.panel-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
}
.inline-form input {
  max-width: 250px;
}

/* SEARCHABLE CLIENT DROPDOWN */
.dropdown-container {
  position: relative;
}

.dropdown-wrapper {
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  padding-left: 2.25rem;
  padding-right: 3.2rem;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-input-wrapper .clear-search-btn {
  position: absolute;
  right: 2.2rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, transform 0.2s;
  z-index: 5;
}

.search-input-wrapper .clear-search-btn:hover {
  color: #ef4444;
  transform: scale(1.15);
}

.search-input-wrapper .arrow-icon,
.search-input-wrapper .dropdown-arrow {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform 0.2s;
  pointer-events: none;
}

.dropdown-container.open .arrow-icon,
.dropdown-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.15);
}

.dropdown-container.open .dropdown-list {
  display: block;
}

.dropdown-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dropdown-item:hover {
  background-color: #f1f5f9;
  color: var(--color-accent);
}

.dropdown-item.selected {
  background-color: #eff6ff;
  color: var(--color-accent);
  font-weight: 600;
}

.dropdown-no-results {
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* SECURITY CHECKS LIST */
.security-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.security-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.sec-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}

.security-list li:nth-child(2) .sec-icon {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.security-list li:nth-child(3) .sec-icon {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.sec-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.sec-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* DATA TABLE */
.table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
}

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

.data-table th, .data-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr {
  background-color: #ffffff;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tfoot tr {
  background-color: #eff6ff !important;
  font-weight: 700;
  border-top: 2px solid var(--color-accent);
}

.data-table tfoot td {
  padding: 0.5rem 0.6rem;
  color: #1e40af;
}

.ad-creative-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s;
  background-color: #f8fafc;
}

.ad-creative-thumbnail:hover {
  transform: scale(2.2);
  box-shadow: 0 10px 20px rgba(15,23,42,0.15);
  z-index: 100;
  position: relative;
}

.badge-info {
  background-color: #eff6ff;
  color: var(--color-accent);
  border: 1px solid #dbeafe;
  padding: 0.15rem 0.55rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

/* SETTINGS VIEW: CHECKBOX LIST */
.checkbox-list-container {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  max-height: 250px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  color: var(--text-primary);
}

.checkbox-item:last-child {
  border-bottom: none;
}

.checkbox-item:hover {
  background-color: #f8fafc;
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--color-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-item span {
  font-size: 0.95rem;
}

.checkbox-item small {
  color: var(--text-muted);
  margin-left: auto;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  width: 95%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  color: var(--text-primary);
}

/* PC Specific Draft Modal Spacing */
@media (min-width: 769px) {
  #draft-modal .modal-container {
    max-width: 98vw;
    width: 98%;
  }
  #draft-modal .table-container {
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: var(--radius-sm);
  }
  #draft-modal .data-table {
    width: auto;
  }
  #draft-modal .data-table th,
  #draft-modal .data-table td {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff;
}

.modal-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.header-success h3 i {
  color: var(--color-success);
}

.close-modal-btn {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 0.25rem;
  border: none;
  cursor: pointer;
}
.close-modal-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  background-color: #ffffff;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #f8fafc;
}

/* SUMMARY RECEIPT FOR COPY */
.summary-capture-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: left;
  max-width: 380px;
  margin: 0.5rem auto 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.summary-capture-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-success) 100%);
}

.summary-card-header {
  text-align: center;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.summary-card-header .fb-icon {
  font-size: 1.75rem;
  color: var(--color-accent);
  background: #eff6ff;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  border: 1px solid #dbeafe;
}

.summary-card-header h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.summary-card-header p {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.summary-row strong {
  color: var(--text-primary);
}

.summary-row.highlight {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: #166534;
  font-size: 1rem;
}

.summary-row.highlight strong {
  color: #15803d;
  font-size: 1.15rem;
}

.summary-footer {
  border-top: 1px dashed #e2e8f0;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.summary-footer span {
  display: block;
  margin-bottom: 0.15rem;
  font-family: monospace;
}

/* GLOBAL SPINNER LOADER */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loader-overlay.active {
  display: flex;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#loader-text {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ANIMATIONS */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Menu Toggle Button in Navbar */
.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
  background-color: #f1f5f9;
}

/* Mobile Sidebar Drawer */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 10px 0 30px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 9999;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
}

.mobile-sidebar.active {
  left: 0;
}

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

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-btn:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.sidebar-btn.active {
  color: var(--color-accent);
  background-color: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-user-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* MOBILE RESPONSIVE LAYOUT FOR DATA TABLE & HEADER */
@media (max-width: 768px) {
  .modal-container {
    max-height: 96vh;
    border-radius: var(--radius-md);
    padding: 0.5rem;
    width: 98vw;
  }
  
  .table-container {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table th, .data-table td {
    padding: 0.35rem 0.4rem;
    font-size: 0.8rem;
  }
  .data-table tfoot td {
    padding: 0.35rem 0.4rem;
  }
  
  .menu-toggle-btn {
    display: block;
  }
  
  .nav-links, .nav-user {
    display: none !important;
  }
  
  .navbar {
    margin: 1rem;
    padding: 0.6rem 1rem;
    justify-content: flex-start;
    gap: 1.25rem;
  }
}

/* STATUS PORTAL ROW ITEM */
.status-row-item {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed #e2e8f0;
}

.status-row-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.status-select-group {
  width: 120px;
}

.datetime-picker-group {
  width: 250px;
}

.btn-clear-row, .btn-delete-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  height: 42px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-row {
  color: var(--text-secondary);
}

.btn-clear-row:hover {
  color: #d97706;
  background-color: #fef3c7;
  border-color: #fde68a;
}

.btn-delete-row {
  color: #ef4444;
  border-color: #fecaca;
  background-color: #fef2f2;
}

.btn-delete-row:hover {
  color: #ffffff;
  background-color: #ef4444;
  border-color: #dc2626;
}

.status-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  height: 42px;
  cursor: pointer;
}

.status-select:focus {
  border-color: var(--color-accent);
  outline: none;
}

.adset-id-input, .schedule-picker-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  height: 42px;
}

.adset-id-input:focus, .schedule-picker-input:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* Status schedule badge styles */
.badge-status {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-status.pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-status.completed {
  background-color: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-status.failed {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Action text formatting */
.action-on {
  color: #059669;
  font-weight: 700;
}

.action-off {
  color: #dc2626;
  font-weight: 700;
}

/* Mobile optimizations for status row items */
@media (max-width: 768px) {
  .status-row-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
  }
  
  .status-select-group, .datetime-picker-group {
    width: 100%;
  }
  
  .btn-clear-row, .btn-delete-row {
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    justify-content: center;
    gap: 0.5rem;
  }
  
  .btn-clear-row::after {
    content: " Clear Schedule";
    font-size: 0.9rem;
    font-weight: 500;
  }
  
  .btn-delete-row::after {
    content: " Delete Row";
    font-size: 0.9rem;
    font-weight: 500;
  }
}
