/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  line-height: 1.5;
}

/* === Screens === */
.screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.hidden { display: none !important; }

/* === Login === */
.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { margin-bottom: 32px; }
.logo-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.login-logo h1 { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.login-subtitle { color: #94a3b8; font-size: 14px; margin-top: 4px; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px;
  background: #f8fafc; color: #1e293b;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.google-btn:hover { background: #e2e8f0; transform: translateY(-1px); }
.google-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.google-btn svg { flex-shrink: 0; }

.login-status { margin-top: 16px; font-size: 13px; color: #ef4444; min-height: 20px; }

/* === Denied === */
.denied-icon { font-size: 56px; margin-bottom: 16px; }
.denied-text { color: #94a3b8; margin-bottom: 24px; }
.secondary-btn {
  padding: 12px 28px; background: #334155; color: #f8fafc;
  border: 1px solid #475569; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.secondary-btn:hover { background: #475569; }

/* === Loading === */
.loader-wrap { text-align: center; color: #94a3b8; }
.loader {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid #334155; border-top-color: #3b82f6;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Top Bar === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-size: 26px; }
.topbar-left h2 { font-size: 20px; font-weight: 700; }
.topbar-badge {
  font-size: 10px; font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; padding: 3px 10px; border-radius: 6px;
  vertical-align: middle; margin-left: 6px;
  letter-spacing: 0.5px;
}
.topbar-right { display: flex; align-items: center; gap: 20px; }
.admin-profile {
  display: flex; align-items: center; gap: 12px;
  background: #0f172a; border: 1px solid #334155;
  border-radius: 12px; padding: 8px 16px 8px 10px;
}
.admin-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0; border: 2px solid #475569;
}
.admin-info { display: flex; flex-direction: column; line-height: 1.3; }
.admin-name { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.admin-email { font-size: 12px; color: #64748b; }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: #0f172a; color: #94a3b8;
  border: 1px solid #334155; border-radius: 12px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.logout-btn:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.logout-btn svg { flex-shrink: 0; }

/* === Dashboard === */
#dashboard-screen { display: none; flex-direction: column; min-height: 100vh; }
#dashboard-screen:not(.hidden) { display: flex; }

.dashboard-content { padding: 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  display: flex; align-items: center; gap: 16px;
  background: #1e293b; border: 1px solid #334155;
  border-radius: 14px; padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* === Panel === */
.panel {
  background: #1e293b; border: 1px solid #334155;
  border-radius: 14px; overflow: hidden; margin-bottom: 24px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #334155;
}
.panel-header h3 { font-size: 16px; font-weight: 700; }
.panel-badge {
  font-size: 12px; font-weight: 700;
  background: #3b82f61a; color: #3b82f6;
  padding: 2px 10px; border-radius: 8px;
}
.badge-warn { background: #ef44441a; color: #ef4444; }
.panel-warn { border-color: #7f1d1d44; }
.badge-promo { background: #8b5cf61a; color: #8b5cf6; }
.panel-promo { border-color: #7c3aed44; }
.promo-header-tools { display: flex; align-items: center; gap: 10px; }
.promo-filter-select { min-width: 170px; max-width: 190px; }
.promo-forms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 8px;
}
.promo-form-card {
  background: #172033;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
}
.promo-form-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
}
.promo-form-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}
.promo-gen-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 0 4px; }
.promo-gen-bar.compact {
  margin-bottom: 0;
  padding: 0;
}
.promo-gen-bar.compact .filter-input {
  flex: 1 1 140px;
  min-width: 120px;
}
.promo-gen-bar.compact .promo-gen-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.promo-gen-btn { background: #8b5cf6; color: #fff; border: none; padding: 9px 22px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .2s; }
.promo-gen-btn:hover { background: #7c3aed; }
.promo-gen-btn:disabled { opacity: .5; cursor: not-allowed; }
.promo-code-cell { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: 1px; font-size: 13px; }
.promo-active { color: #16a34a; font-weight: 700; }
.promo-used { color: #64748b; }
.promo-del-btn { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 4px; transition: color .2s; }
.promo-del-btn:hover { color: #ef4444; }

/* === Filter Bar === */
.filter-bar {
  display: flex; gap: 10px; padding: 12px 20px;
  border-bottom: 1px solid #334155; background: #172033;
}
.filter-input {
  flex: 1; padding: 10px 14px;
  background: #0f172a; color: #f8fafc;
  border: 1px solid #334155; border-radius: 8px;
  font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.filter-input::placeholder { color: #64748b; }
.filter-input:focus { border-color: #3b82f6; }

/* === Table === */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 16px;
  font-size: 12px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: #0f172a; white-space: nowrap;
}
tbody td {
  padding: 12px 16px; font-size: 14px;
  border-bottom: 1px solid #1a2536;
}
tbody tr:hover { background: #253349; }
.empty-row { text-align: center; color: #64748b; padding: 32px 16px !important; }

/* === Shared Count Chip === */
.shared-count-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; background: #3b82f61a; color: #93c5fd;
  border: 1px solid #3b82f633; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.shared-count-btn:hover { background: #3b82f633; border-color: #3b82f6; }
.shared-count-btn svg { width: 12px; height: 12px; }

/* === Row Delete Button === */
.row-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid #334155;
  color: #64748b; cursor: pointer; transition: all 0.2s;
}
.row-delete-btn:hover { background: #ef44441a; border-color: #ef4444; color: #ef4444; }
.row-delete-btn svg { width: 16px; height: 16px; }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: #1e293b; border: 1px solid #334155;
  border-radius: 16px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sm { max-width: 340px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #334155;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: #0f172a; border: 1px solid #334155; border-radius: 8px;
  color: #94a3b8; font-size: 18px; cursor: pointer; transition: all 0.2s; line-height: 1;
}
.modal-close:hover { background: #334155; color: #f8fafc; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 20px; border-top: 1px solid #334155;
}

/* === Shared List (popup) === */
.shared-list { list-style: none; padding: 8px 0; margin: 0; }
.shared-list li {
  padding: 10px 20px; font-size: 13px; color: #cbd5e1;
  border-bottom: 1px solid #1a2536; display: flex; align-items: center; gap: 8px;
}
.shared-list li:last-child { border-bottom: none; }
.shared-list .list-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3b82f6; flex-shrink: 0;
}

/* === Delete Modal === */
.delete-plate {
  font-size: 18px; font-weight: 800; text-align: center;
  margin-bottom: 12px; color: #f8fafc; letter-spacing: 1px;
}
.delete-info { font-size: 13px; color: #94a3b8; margin-bottom: 16px; line-height: 1.5; }
.delete-owner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #0f172a; border-radius: 8px;
  margin-bottom: 14px; font-size: 13px;
}
.delete-owner span { color: #64748b; }
.delete-owner strong { color: #fbbf24; user-select: all; word-break: break-all; }
.delete-error { font-size: 12px; color: #ef4444; margin-top: 8px; min-height: 18px; }
.delete-btn {
  padding: 10px 24px; background: #dc2626; color: #fff;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.delete-btn:hover { background: #b91c1c; }
.delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Pagination === */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 14px 20px;
  border-top: 1px solid #334155;
}
.pagination:empty { display: none; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #94a3b8;
  border: 1px solid #334155; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.page-btn:hover:not(:disabled):not(.active) { background: #334155; color: #f8fafc; }
.page-btn.active {
  background: #3b82f6; color: #fff;
  border-color: #3b82f6; pointer-events: none;
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-dots {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; color: #64748b; font-size: 14px; letter-spacing: 2px;
}

/* === Premium Management === */
.panel-premium { border-color: #a855f744; }
.badge-premium { background: #a855f71a; color: #a855f7; font-size: 14px; }
.premium-grant-bar {
  display: flex; gap: 10px; padding: 16px 20px; align-items: center; flex-wrap: wrap;
}
.premium-grant-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  white-space: nowrap;
}
.premium-grant-btn:hover { filter: brightness(1.1); }
.premium-status {
  padding: 0 20px 12px; font-size: 13px; min-height: 18px;
}
.premium-status.success { color: #4ade80; }
.premium-status.error { color: #f87171; }
.premium-revoke-btn {
  background: none; border: 1px solid #ef444466; color: #f87171;
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.premium-revoke-btn:hover { background: #ef44441a; border-color: #ef4444; }
.premium-revoke-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === App Settings === */
.panel-settings { border-color: #16a34a44; }
.badge-settings { background: #16a34a1a; color: #16a34a; font-size: 14px; }
.settings-body { padding: 20px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.setting-row-spaced { margin-top: 20px; padding-top: 20px; border-top: 1px solid #334155; }
.setting-price-input { width: 110px; min-width: 90px; text-align: center; }
.setting-info { flex: 1; min-width: 200px; }
.setting-label { display: block; font-size: 14px; font-weight: 700; color: #f1f5f9; margin-bottom: 4px; }
.setting-desc { display: block; font-size: 12px; color: #64748b; line-height: 1.5; }
.setting-control {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.setting-input {
  width: 80px; text-align: center; font-weight: 700; font-size: 16px;
  padding: 10px 8px; flex: none;
}
.setting-unit { font-size: 14px; color: #94a3b8; font-weight: 600; }

/* === Filo hesapları === */
.panel-fleet { border-color: #0ea5e9; }
.badge-fleet { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.fleet-intro {
  font-size: 13px; color: #94a3b8; line-height: 1.55;
  margin: 0 0 16px; padding: 0 4px;
}
.fleet-create-bar { margin-bottom: 8px; }
.fleet-create-btn { white-space: nowrap; }
.fleet-pwd-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fbbf24;
  border: 1px solid #334155;
}
.fleet-pwd-hint { font-size: 12px; color: #64748b; }
.fleet-pwd-custom { font-size: 13px; color: #a78bfa; font-weight: 600; }
.fleet-pwd-date { font-size: 11px; color: #64748b; }
.fleet-actions-cell {
  white-space: nowrap;
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
}
.fleet-action-btn {
  padding: 6px 12px;
  font-size: 12px; font-weight: 600; font-family: inherit;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fleet-action-btn:hover { background: #334155; border-color: #475569; }
.fleet-action-danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.fleet-action-danger:hover { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; }
.fleet-modal-email {
  font-size: 14px; font-weight: 600; color: #f1f5f9;
  margin-bottom: 12px; word-break: break-all;
}
.fleet-pwd-label {
  display: block; font-size: 12px; font-weight: 600; color: #94a3b8;
  margin: 10px 0 6px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-left h2 { font-size: 15px; }
  .admin-info { display: none; }
  .admin-profile { padding: 6px 8px; }
  .admin-avatar { width: 32px; height: 32px; font-size: 12px; }
  .logout-btn { padding: 8px 12px; font-size: 12px; }
  .logout-btn span { display: none; }
  .topbar-right { gap: 10px; }
  .dashboard-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 18px; }
  .stat-value { font-size: 20px; }
  .login-card { padding: 32px 24px; }
  thead th, tbody td { padding: 10px 12px; font-size: 13px; }
  .filter-bar { flex-direction: column; gap: 8px; padding: 10px 16px; }
  .promo-forms-grid { grid-template-columns: 1fr; padding: 12px 12px 8px; }
  .promo-header-tools { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .promo-filter-select { min-width: 150px; }
  .promo-gen-bar.compact { flex-direction: column; align-items: stretch; }
  .promo-gen-bar.compact .filter-input,
  .promo-gen-bar.compact .promo-gen-btn { width: 100%; }
  .modal-card { margin: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { flex-direction: column; text-align: center; padding: 12px; gap: 8px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 11px; }
}
