:root {
    --bg-primary: #1a1d23;
    --bg-secondary: #212529;
    --bg-tertiary: #2c3034;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #6c757d;
    --border-color: #2c3034;
    --accent-blue: #0d6efd;
    --accent-green: #198754;
    --accent-yellow: #ffc107;
    --accent-red: #dc3545;
    --accent-info: #0dcaf0;
    --sidebar-width: 250px;
    --nav-height: 60px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: #8bb9fe; }
.top-nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height); background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 20px; z-index: 1000; }
.nav-brand { flex-shrink: 0; margin-right: 30px; }
.nav-brand a { color: var(--text-primary); font-size: 1.2rem; font-weight: 700; }
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }
.nav-menu { display: flex; list-style: none; flex-grow: 1; gap: 5px; }
.nav-menu li a { color: var(--text-secondary); padding: 8px 14px; border-radius: 6px; font-size: 0.9rem; transition: all 0.2s; white-space: nowrap; }
.nav-menu li a:hover, .nav-menu li a.active { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-user { flex-shrink: 0; display: flex; align-items: center; gap: 15px; margin-left: auto; }
.nav-user span { color: var(--text-secondary); font-size: 0.9rem; }
.nav-user .company-name { color: var(--accent-info); font-weight: 600; }
.btn-logout { padding: 6px 16px; background: var(--accent-red); color: #fff; border-radius: 6px; font-size: 0.85rem; transition: background 0.2s; }
.btn-logout:hover { background: #bb2d3b; color: #fff; }
.sidebar { position: fixed; top: var(--nav-height); left: 0; bottom: 0; width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border-color); overflow-y: auto; padding: 15px 0; z-index: 999; }
.sidebar ul { list-style: none; }
.sidebar ul li a { display: block; padding: 10px 20px; color: var(--text-secondary); font-size: 0.9rem; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar ul li a:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.sidebar ul li a.active { color: var(--accent-blue); background: rgba(13,110,253,0.1); border-left-color: var(--accent-blue); }
.main-content { margin-top: var(--nav-height); margin-left: var(--sidebar-width); padding: 25px; min-height: calc(100vh - var(--nav-height)); }
.card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 20px; }
.card-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 1.1rem; }
.card-body { padding: 20px; }
.card-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); }
.stat-card { border-left: 4px solid; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card.ppc { border-left-color: var(--accent-blue); }
.stat-card.protect { border-left-color: var(--accent-green); }
.stat-card.total { border-left-color: var(--accent-yellow); }
.stat-card.entries-card { border-left-color: var(--accent-red); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; margin-top: 5px; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.company-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 30px; cursor: pointer; transition: all 0.3s; text-align: center; }
.company-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); border-color: var(--accent-blue); }
.company-card .company-name { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.company-card .company-address { color: var(--text-secondary); font-size: 0.85rem; }
.company-card .company-icon { font-size: 3rem; margin-bottom: 15px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.form-control { width: 100%; padding: 10px 14px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 0.95rem; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(13,110,253,0.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-inline .form-group { margin-bottom: 0; }
.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; text-align: center; font-weight: 500; }
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #0b5ed7; }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-success:hover { background: #157347; }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #bb2d3b; }
.btn-warning { background: var(--accent-yellow); color: #000; }
.btn-warning:hover { background: #ffca2c; }
.btn-info { background: var(--accent-info); color: #000; }
.btn-info:hover { background: #31d2f2; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: #3a3f47; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 30px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
table th { background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
table tr:hover td { background: rgba(255,255,255,0.02); }
table .actions { display: flex; gap: 5px; white-space: nowrap; }
.table-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.table-info { font-size: 0.85rem; color: var(--text-muted); }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; list-style: none; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: block; padding: 8px 14px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 0.85rem; }
.pagination li a:hover { background: var(--bg-tertiary); }
.pagination li.active span { background: var(--accent-blue); border-color: var(--accent-blue); }
.pagination li.disabled span { color: var(--text-muted); cursor: not-allowed; }
.alert { padding: 12px 18px; border-radius: 6px; margin-bottom: 15px; font-size: 0.9rem; }
.alert-danger { background: rgba(220,53,69,0.15); border: 1px solid rgba(220,53,69,0.3); color: #f1aeb5; }
.alert-success { background: rgba(25,135,84,0.15); border: 1px solid rgba(25,135,84,0.3); color: #a3cfbb; }
.alert-info { background: rgba(13,202,240,0.15); border: 1px solid rgba(13,202,240,0.3); color: #9eeaf9; }
.alert-warning { background: rgba(255,193,7,0.15); border: 1px solid rgba(255,193,7,0.3); color: #ffda6a; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }
.toast { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 18px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); min-width: 280px; animation: slideIn 0.3s ease; }
.toast-success { border-left: 4px solid var(--accent-green); }
.toast-error { border-left: 4px solid var(--accent-red); }
.toast-info { border-left: 4px solid var(--accent-blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
#loadingSpinner { display: none !important; }
#loadingSpinner.active { display: flex !important; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; padding: 15px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.8rem; color: var(--text-secondary); }
.filter-group select, .filter-group input { padding: 7px 12px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 5px; color: var(--text-primary); font-size: 0.85rem; }
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: var(--accent-blue); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 20px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent-blue); }
.bulk-actions { display: none; align-items: center; gap: 10px; padding: 10px; background: var(--bg-tertiary); border-radius: 6px; margin-bottom: 10px; }
.bulk-actions.visible { display: flex; }
.report-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 25px; text-align: center; transition: all 0.3s; cursor: default; }
.report-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.report-card .icon { font-size: 2.5rem; margin-bottom: 10px; }
.report-card .title { font-size: 1.1rem; font-weight: 600; }
.report-card .desc { color: var(--text-secondary); font-size: 0.85rem; margin-top: 5px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-primary); }
.login-box { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.login-box h2 { text-align: center; margin-bottom: 25px; font-size: 1.5rem; }
.login-box .logo { text-align: center; font-size: 3rem; margin-bottom: 10px; }
.chart-container { position: relative; height: 350px; margin: 20px 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 4rem; margin-bottom: 15px; }
.empty-state p { font-size: 1.1rem; }
.date-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.date-filter .btn { font-size: 0.82rem; padding: 6px 14px; }
.date-filter .btn.active-btn { background: var(--accent-blue); color: #fff; }
@media print {
    .top-nav, .sidebar, .no-print, .btn, .filter-bar, .bulk-actions { display: none !important; }
    .main-content { margin: 0 !important; padding: 20px !important; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; background: #fff; }
    table th { background: #f0f0f0 !important; color: #000 !important; }
    table td, table th { border-bottom: 1px solid #ddd !important; color: #000 !important; }
}
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-secondary); flex-direction: column; padding: 10px; border-bottom: 1px solid var(--border-color); }
    .nav-menu.open { display: flex; }
    .nav-user .company-name, .nav-user .user-name { display: none; }
    .sidebar { display: none; }
    .sidebar.active { display: block; }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; padding: 15px; }
    .sidebar-overlay.active { display: block; }
    .company-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card .stat-value { font-size: 1.3rem; }
    .filter-bar { flex-direction: column; }
    .modal { max-width: 95% !important; margin: 10px; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container table { min-width: 650px; }
    table th, table td { white-space: nowrap; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .export-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
    .company-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   6. Forms & Buttons
   ============================================================ */

label {
  display: block;
  color: #e0e0e0;
  margin-bottom: 5px;
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0f3460;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: #f0a500;
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: #666;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

fieldset {
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

legend {
  color: #f0a500;
  font-weight: 600;
  padding: 0 8px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row > * {
  flex: 1;
  min-width: 0;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: auto;
  accent-color: #f0a500;
}

.form-check label {
  margin-bottom: 0;
  cursor: pointer;
}

.form-help {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #f0a500;
  color: #1a1a2e;
}

.btn-primary:hover:not(:disabled) {
  background: #d49400;
  box-shadow: 0 4px 12px rgba(240, 165, 0, 0.3);
}

.btn-secondary {
  background: #06a77d;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #05906b;
  box-shadow: 0 4px 12px rgba(6, 167, 125, 0.3);
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #c0392b;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-outline {
  background: transparent;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
}

.btn-outline:hover:not(:disabled) {
  background: #2a2a4a;
  border-color: #f0a500;
  color: #f0a500;
}

.btn-outline-primary {
  background: transparent;
  color: #f0a500;
  border: 1px solid #f0a500;
}

.btn-outline-primary:hover:not(:disabled) {
  background: #f0a500;
  color: #1a1a2e;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1.1rem;
}


/* ============================================================
   7. Tables
   ============================================================ */

.table-container {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background: #0f3460;
  color: #e0e0e0;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px;
  text-align: left;
  border-bottom: 2px solid #f0a500;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody tr {
  border-bottom: 1px solid #2a2a4a;
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(240, 165, 0, 0.04);
}

.table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:nth-child(even):hover {
  background: rgba(240, 165, 0, 0.06);
}

.table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  vertical-align: middle;
}

.table .table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.table .table-actions .btn {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   8. Badges & Status
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-active {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.badge-inactive {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.badge-pending {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.badge-admin {
  background: rgba(240, 165, 0, 0.2);
  color: #f0a500;
}

.badge-user {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.badge-success {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.badge-danger {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.badge-warning {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.badge-info {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}


/* ============================================================
   9. Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  visibility: visible;
  opacity: 1;
}

.modal {
  background: #16213e;
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.25s ease;
}

.modal.wide {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2a2a4a;
}

.modal-header h2,
.modal-header h3 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.modal-header .close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-header .close-btn:hover {
  color: #e74c3c;
}

.modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-top: 1px solid #2a2a4a;
}

/* ============================================================
   10. Toast Notifications
   ============================================================ */

#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #16213e;
  color: #e0e0e0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  border-left: 4px solid #888;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.toast-hiding {
  animation: slideOut 0.3s ease forwards;
}

.toast-success {
  border-left-color: #2ecc71;
}

.toast-error {
  border-left-color: #e74c3c;
}

.toast-info {
  border-left-color: #3498db;
}

.toast-warning {
  border-left-color: #f39c12;
}

.toast .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: #2ecc71;
}

.toast-error .toast-icon {
  color: #e74c3c;
}

.toast-info .toast-icon {
  color: #3498db;
}

.toast-warning .toast-icon {
  color: #f39c12;
}

.toast .toast-body {
  flex: 1;
}

.toast .toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast .toast-message {
  color: #b0b0b0;
  font-size: 0.85rem;
}

.toast .toast-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.toast .toast-close:hover {
  color: #e74c3c;
}


/* ============================================================
   11. Loading Spinner
   ============================================================ */

#loadingSpinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

#loadingSpinner.active {
  display: flex;
}

.spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 46, 0.7);
}

.spinner {
  position: relative;
  width: 48px;
  height: 48px;
  border: 4px solid #2a2a4a;
  border-top-color: #f0a500;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}

.loading-text {
  position: relative;
  z-index: 1;
  color: #f0a500;
  margin-top: 12px;
  font-size: 0.9rem;
  text-align: center;
}

/* ============================================================
   12. Login Page
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 20px;
}

.login-card {
  background: #16213e;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.login-logo {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0a500;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.login-form input {
  padding: 12px 14px;
}

.login-form .btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.login-error {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid rgba(231, 76, 60, 0.25);
}

/* ============================================================
   13. Company Selection
   ============================================================ */

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.company-card {
  background: #16213e;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  border-top: 3px solid transparent;
}

.company-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-top-color: #f0a500;
}

.company-card .name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 6px;
}

.company-card .info {
  font-size: 0.85rem;
  color: #888;
}

.company-card .info span {
  display: block;
  margin-top: 3px;
}


/* ============================================================
   14. Dashboard
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-grid .card {
  text-align: center;
}

.stats-grid .card-value {
  font-size: 2rem;
}

.stats-grid .card-label {
  font-size: 0.82rem;
}

.chart-container {
  background: #16213e;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.chart-container .chart-area {
  width: 100%;
  aspect-ratio: 16 / 6;
  background: #1a1a2e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.9rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.filter-bar .filter-label {
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #2a2a4a;
  background: transparent;
  color: #b0b0b0;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: #f0a500;
  color: #f0a500;
}

.filter-btn.active {
  background: #f0a500;
  color: #1a1a2e;
  border-color: #f0a500;
  font-weight: 500;
}

/* ============================================================
   15. Date Filter Buttons
   ============================================================ */

.date-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.date-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #2a2a4a;
  background: #0f3460;
  color: #b0b0b0;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.date-filter-btn:hover {
  border-color: #f0a500;
  color: #f0a500;
}

.date-filter-btn.active {
  background: #f0a500;
  color: #1a1a2e;
  border-color: #f0a500;
  font-weight: 500;
}

/* ============================================================
   16. Daily Entry Form
   ============================================================ */

.entry-form {
  background: #16213e;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.entry-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.entry-fields .form-group {
  margin-bottom: 0;
}


/* ============================================================
   17. All Entries (Search, Bulk Actions)
   ============================================================ */

.search-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
}

.search-bar select {
  width: auto;
  min-width: 150px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #0f3460;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  display: none;
}

.bulk-actions.visible {
  display: flex;
}

.bulk-actions .count {
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-right: 10px;
}

.bulk-actions .count strong {
  color: #f0a500;
}

/* ============================================================
   18. Reports
   ============================================================ */

.report-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
  border-bottom: 1px solid #2a2a4a;
  overflow-x: auto;
}

.report-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.report-tab:hover {
  color: #f0a500;
}

.report-tab.active {
  color: #f0a500;
  border-bottom-color: #f0a500;
  font-weight: 500;
}

.report-content {
  background: #16213e;
  border-radius: 8px;
  padding: 1.5rem;
}

.print-section {
  padding: 1rem;
  background: #1a1a2e;
  border-radius: 6px;
  margin-top: 1rem;
}

.print-section .print-header {
  text-align: center;
  margin-bottom: 1rem;
}

.print-section .print-header h2 {
  color: #f0a500;
}

.print-section .print-details {
  font-size: 0.88rem;
  line-height: 1.8;
}

/* ============================================================
   19. Export Page
   ============================================================ */

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.export-card {
  background: #16213e;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #2a2a4a;
}

.export-card:hover {
  border-color: #f0a500;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.export-card .export-icon {
  font-size: 2.5rem;
  color: #f0a500;
  margin-bottom: 0.75rem;
}

.export-card .export-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 4px;
}

.export-card .export-desc {
  font-size: 0.82rem;
  color: #888;
}

/* ============================================================
   20. Pagination
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 1.5rem;
}

.page-item {
  padding: 8px 14px;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #16213e;
  color: #b0b0b0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  min-width: 38px;
  text-align: center;
}

.page-item:hover:not(.active):not(.disabled) {
  border-color: #f0a500;
  color: #f0a500;
}

.page-item.active {
  background: #f0a500;
  color: #1a1a2e;
  border-color: #f0a500;
  font-weight: 600;
}

.page-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ============================================================
   21. Responsive Design
   ============================================================ */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-container .chart-area {
    aspect-ratio: 16 / 8;
  }

  .entry-fields {
    grid-template-columns: 1fr 1fr;
  }

  .page-content {
    padding: 1.25rem;
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  html {
    font-size: 15px;
  }

  .sidebar {
    transform: translateX(-250px);
  }
  .sidebar.active { transform: translateX(0); }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .hamburger-toggle {
    display: block;
  }

  .topbar-brand .hamburger {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .card-grid,
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row > * {
    width: 100%;
  }

  .entry-fields {
    grid-template-columns: 1fr;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar select {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .page-actions {
    width: 100%;
  }

  .report-tabs {
    flex-wrap: nowrap;
  }

  .company-grid {
    grid-template-columns: 1fr;
  }

  .export-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 95%;
    margin: 10px;
  }

  #toastContainer {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .table thead th,
  .table td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .date-filters {
    flex-wrap: wrap;
  }

  .login-card {
    padding: 1.5rem;
  }

  .topbar {
    padding: 0 1rem;
    height: 56px;
  }

  .topbar-user .user-name {
    display: none;
  }

  .page-content {
    padding: 1rem;
  }
}

/* Small phones: < 480px */
@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .card-value {
    font-size: 1.4rem;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .stats-grid .card-value {
    font-size: 1.5rem;
  }

  .chart-container .chart-area {
    aspect-ratio: 4 / 3;
  }
}


/* ============================================================
   22. Print Styles
   ============================================================ */

@media print {
  .sidebar,
  .topbar,
  .page-header .page-actions,
  .btn,
  .table-actions,
  .search-bar,
  .bulk-actions,
  .filter-bar,
  .date-filters,
  .report-tabs,
  .pagination,
  .modal-overlay,
  #toastContainer,
  #loadingSpinner {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .card,
  .table,
  .report-content,
  .print-section {
    box-shadow: none;
    background: none;
    border: 1px solid #ddd;
    color: #000;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12px;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000;
  }

  .card-title {
    color: #000;
  }

  .card-value {
    color: #000;
  }

  .table thead th {
    background: #f5f5f5;
    color: #000;
    border-bottom-color: #000;
  }

  .table tbody tr {
    border-bottom-color: #ddd;
  }

  .badge {
    border: 1px solid #ccc;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .page-content {
    padding: 0;
  }

  .print-only {
    display: block !important;
  }
}

.print-only {
  display: none;
}

/* ============================================================
   23. Animations
   ============================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Transition on all interactive elements */
a,
button,
input,
select,
textarea,
.btn,
.card,
.badge,
.page-item,
.filter-btn,
.date-filter-btn {
  transition: all 0.2s ease;
}


/* ============================================================
   24. Utility Classes
   ============================================================ */

/* Text alignment */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

/* Gap */
.gap-5 {
  gap: 5px;
}

.gap-10 {
  gap: 10px;
}

.gap-15 {
  gap: 15px;
}

.gap-20 {
  gap: 20px;
}

/* Margin */
.mt-5 {
  margin-top: 5px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-5 {
  margin-bottom: 5px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.ml-10 {
  margin-left: 10px;
}

.mr-10 {
  margin-right: 10px;
}

/* Padding */
.p-10 {
  padding: 10px;
}

.p-15 {
  padding: 15px;
}

.p-20 {
  padding: 20px;
}

/* Width / Height */
.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

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

.show {
  display: block !important;
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

/* Borders */
.rounded {
  border-radius: 8px;
}

.rounded-full {
  border-radius: 50%;
}

.border {
  border: 1px solid #2a2a4a;
}

.border-top {
  border-top: 1px solid #2a2a4a;
}

.border-bottom {
  border-bottom: 1px solid #2a2a4a;
}

/* Shadows */
.shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.shadow-lg {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

/* Font weight */
.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

/* Text truncation */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nowrap {
  white-space: nowrap;
}

/* Background colors */
.bg-dark {
  background: #1a1a2e;
}

.bg-card {
  background: #16213e;
}

.bg-input {
  background: #0f3460;
}

/* Pill style */
.pill {
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: #b0b0b0;
  margin-bottom: 0.5rem;
}

