/* assets/css/style.css */

:root {
    --bg-gradient: linear-gradient(135deg, #1f2933, #111827);
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --danger: #ef4444;
    --success: #10b981;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --card-bg: rgba(15, 23, 42, 0.65);
    --border-glass: rgba(148, 163, 184, 0.35);
    --shadow-glass: 0 20px 40px rgba(15, 23, 42, 0.8);
    --radius-lg: 18px;
    --radius-full: 999px;
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.25s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  
  body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  
  .main-wrapper {
    width: 100%;
    max-width: 1180px;
  }
  
  .glass-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 28px 26px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }

  /* Mobile Safari/Chrome touch fallback:
     Some mobile browsers have touch issues with backdrop-filter + overflow hidden. */
  @media (hover: none) and (pointer: coarse) {
    .glass-card {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      overflow: visible;
    }
    .glass-card::before {
      display: none;
    }
    .top-nav-actions a.btn,
    .top-nav-actions button.btn {
      position: relative;
      z-index: 10;
    }
    button,
    a,
    input,
    select,
    textarea {
      touch-action: manipulation;
    }
  }

  /* iOS Safari specific hint (keeps desktop blur off to avoid touch bugs) */
  @supports (-webkit-touch-callout: none) {
    .glass-card {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      overflow: visible;
    }
    .glass-card::before {
      display: none;
    }
  }
  
  .glass-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 58%),
                radial-gradient(circle at bottom right, rgba(52, 211, 153, 0.14), transparent 55%);
    opacity: 0.9;
    z-index: -1;
    pointer-events: none;
  }
  
  /* Auth layout */
  .auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px;
    align-items: stretch;
  }
  
  @media (max-width: 820px) {
    .auth-layout {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  
  .auth-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
  }
  
  .auth-kicker {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
  color: #ffffff;
  }
  
  .auth-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
  }
  
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.78rem;
    color: var(--text-muted);
  }
  
  .badge-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: radial-gradient(circle, var(--success), #22c55e);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  }
  
  .metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
  }
  
  .metric-pill {
    padding: 8px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: rgba(15, 23, 42, 0.7);
    font-size: 0.8rem;
  }
  
  .metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
  }
  
  .metric-value {
    font-weight: 600;
  }
  
  /* Forms */
  .form-title {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }
  
  .form-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 18px;
  }
  
  .form-group {
    margin-bottom: 14px;
  }
  
  .form-label {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--text-muted);
  }
  
  .form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background-color: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
  }

/* Date inputs – custom calendar icon tint to match accent */
input[type="date"].form-control::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(78%) saturate(540%) hue-rotate(200deg) brightness(102%) contrast(98%);
  cursor: pointer;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator:hover {
  filter: invert(82%) sepia(88%) saturate(740%) hue-rotate(200deg) brightness(108%) contrast(101%);
}

  
  .form-control::placeholder {
    color: rgba(148, 163, 184, 0.7);
  }
  
  .form-control:focus {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.55);
    background-color: rgba(15, 23, 42, 0.98);
    transform: translateY(-1px);
  }
  
  .select-control {
    background-image: linear-gradient(45deg, transparent 50%, rgba(148, 163, 184, 0.7) 50%),
                      linear-gradient(135deg, rgba(148, 163, 184, 0.7) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    appearance: none;
  }
  
  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color var(--transition-med), box-shadow var(--transition-med), transform var(--transition-med), color var(--transition-med);
  }
  
  .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #e5e7eb;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.4);
  }
 

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(37, 99, 235, 0.85);
}

/* Ensure Export buttons inside filter forms have same size */
form button.btn.btn-primary {
  min-width: 120px;
}
  .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.5);
  }
  
  .btn-outline {
    background-color: transparent;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: var(--text-muted);
  }
  
  .btn-outline:hover {
    background-color: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    transform: translateY(-1px);
  }
  .btn-export {
    min-width: 120px;
    padding: 0.5em 1.25em;
    font-weight: 600;
}
  
  /* Alerts */
  .alert {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    border: 1px solid transparent;
  }
  
  .alert-error {
    background-color: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
  }
  
  .alert-success {
    background-color: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.5);
    color: #bbf7d0;
  }
  
  /* Links */
  a {
    color: var(--accent);
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  /* Dashboard */
  .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: 22px;
  }
  
  @media (max-width: 960px) {
    .dashboard-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }
  
  .card-title {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
  }
  
  .info-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .info-list li {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed rgba(55, 65, 81, 0.6);
  }
  
  .info-label {
    font-size: 0.84rem;
    color: var(--text-muted);
  }
  
  .info-value {
    font-size: 0.9rem;
    font-weight: 500;
  }
  
  .chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.78rem;
  }
  
  /* Tables (admin) */
  .table-wrapper {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background-color: rgba(15, 23, 42, 0.9);
  }
  
  .table-scroll {
    max-height: 420px;
    overflow: auto;
  }
  
  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
  }
  
  .table th,
  .table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.8);
    white-space: nowrap;
  }
  
  .table th {
    text-align: left;
    font-weight: 600;
    background-color: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
    z-index: 1;
  }
  
  .table tr:hover td {
    background-color: rgba(31, 41, 55, 0.85);
  }
  
  /* Top nav (dashboard) */
  .top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
  }
  
  .top-nav-title {
    font-size: 1.3rem;
    font-weight: 600;
  }
  
  .top-nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  
  /* Simple utility */
  .text-right {
    text-align: right;
  }
  
  .text-muted {
    color: var(--text-muted);
  }
  
  .mb-0 {
    margin-bottom: 0;
  }
  
  .mt-2 {
    margin-top: 8px;
  }
  
  /* Mobile tweaks */
  @media (max-width: 600px) {
    .glass-card {
      padding: 20px 18px;
    }
  
    .top-nav-title {
      font-size: 1.1rem;
    }
  
    .metrics {
      gap: 10px;
    }
  }