/* DESIGN SYSTEM & CONFIGURATION */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #121826;
  --bg-card: rgba(18, 24, 38, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --color-accent: #6366f1; /* Indigo */
  --color-accent-hover: #4f46e5;
  --color-success: #10b981; /* Emerald */
  --color-success-hover: #059669;
  --color-danger: #ef4444; /* Rose */
  --color-warning: #f59e0b; /* Amber */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px 0 rgba(99, 102, 241, 0.15);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* 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: var(--border-color);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
}

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: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: #f472b6;
  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-secondary); }
.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);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.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%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

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

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

.btn-outline-sm {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}
.btn-outline-sm:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  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="datetime-local"] {
  width: 100%;
  padding: 0.65rem 1rem;
  background-color: rgba(255, 255, 255, 0.03);
  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="datetime-local"]:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* LOGIN SCREEN */
#login-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 45%),
              var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

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

.login-card .brand-logo img {
  height: 70px;
  width: 70px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.login-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.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.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  z-index: 10;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
}

.nav-brand img.nav-logo {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

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

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

.nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.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%;
}

.panel-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.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: 2rem;
}

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

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

.dropdown-container.open .arrow-icon {
  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: var(--bg-secondary);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
}

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

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

.dropdown-item:hover {
  background-color: rgba(99, 102, 241, 0.15);
  color: #fff;
}

.dropdown-item.selected {
  background-color: var(--color-accent);
  color: #fff;
}

.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(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 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;
}

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

/* DATA TABLE */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: rgba(0,0,0,0.15);
}

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

.data-table th, .data-table td {
  padding: 0.4rem 0.5rem; /* Tightened padding to align with text */
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.data-table tfoot tr {
  background-color: rgba(99, 102, 241, 0.08) !important;
  font-weight: 700;
  border-top: 2px solid var(--color-accent);
}

.data-table tfoot td {
  padding: 0.4rem 0.5rem;
  color: #fff;
}

.ad-creative-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  transition: transform 0.2s;
  background-color: #121826;
}

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

.badge-info {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--color-accent);
  padding: 0.15rem 0.5rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

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

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

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

.checkbox-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.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(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  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;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* PC Specific Draft Modal Spacing to Prevent Column Cut-off */
@media (min-width: 769px) {
  #draft-modal .modal-container {
    max-width: 98vw;
    width: 98%;
  }
  #draft-modal .table-container {
    border: none;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  #draft-modal .data-table {
    width: auto; /* Shrink table to fit text size instead of stretching to 100% */
  }
  #draft-modal .data-table th,
  #draft-modal .data-table td {
    padding-left: 0.15rem;  /* Minimal horizontal padding to align with text */
    padding-right: 0.15rem;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.close-modal-btn {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 0.25rem;
}
.close-modal-btn:hover {
  color: #fff;
}

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

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(0,0,0,0.1);
}

/* SUMMARY RECEIPT FOR COPY */
.summary-capture-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: left;
  max-width: 380px;
  margin: 0.5rem auto 1.5rem;
  box-shadow: var(--shadow-lg);
  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 rgba(255, 255, 255, 0.1);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

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

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

.summary-card-header p {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  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: #fff;
}

.summary-row.highlight {
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
}

.summary-row.highlight strong {
  color: var(--color-success);
  font-size: 1.15rem;
}

.summary-footer {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  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(11, 15, 25, 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 rgba(99, 102, 241, 0.1);
  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 (Hidden by default on Desktop) */
.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: rgba(255, 255, 255, 0.05);
}

/* Mobile Sidebar Drawer */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -280px; /* Hidden offscreen by default */
  width: 280px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  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; /* Slide in */
}

.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: rgba(255, 255, 255, 0.05);
}

.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: rgba(255, 255, 255, 0.03);
}

.sidebar-btn.active {
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.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;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  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; /* Reduced padding from 1.25rem to 0.5rem to give maximum space */
    width: 98vw; /* Expanded width to 98vw */
  }
  
  .table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: rgba(0,0,0,0.15);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table th, .data-table td {
    padding: 0.35rem 0.4rem; /* Tightened padding on mobile */
    font-size: 0.8rem;
  }
  .data-table tfoot td {
    padding: 0.35rem 0.4rem;
  }
  
  .menu-toggle-btn {
    display: block; /* Show hamburger button */
  }
  
  .nav-links, .nav-user {
    display: none !important; /* Hide desktop header items */
  }
  
  .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 rgba(255, 255, 255, 0.05);
}

.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: none;
  border: none;
  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);
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
}

.btn-clear-row:hover {
  color: #fbbf24; /* yellow */
  background-color: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.btn-delete-row {
  color: #ef4444; /* red */
  border: 1px solid rgba(239, 68, 68, 0.2);
  background-color: rgba(239, 68, 68, 0.02);
}

.btn-delete-row:hover {
  color: #fff;
  background-color: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.status-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  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: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  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: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-status.completed {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status.failed {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

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

.action-off {
  color: #ef4444;
  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 rgba(255, 255, 255, 0.05);
  }
  
  .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;
  }
}
