@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #030712;
  --panel: rgba(11, 15, 26, 0.75);
  --panel-2: rgba(30, 41, 59, 0.7);
  --line: rgba(255, 255, 255, 0.07);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --success-grad: linear-gradient(135deg, #10b981, #059669);
  --danger-grad: linear-gradient(135deg, #ef4444, #e11d48);
  --warn-grad: linear-gradient(135deg, #f59e0b, #d97706);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --accent-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                    radial-gradient(circle at 10% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}

button, .button {
  border: 0;
  border-radius: 10px;
  background: var(--accent-grad);
  color: white;
  padding: 11px 18px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35), var(--accent-glow);
  filter: brightness(1.15);
}

button:active, .button:active {
  transform: translateY(0);
}

button:disabled, .button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white;
}

.success {
  background: var(--success-grad);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), 0 0 15px rgba(16, 185, 129, 0.2);
}

.danger {
  background: var(--danger-grad);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4), 0 0 15px rgba(239, 68, 68, 0.2);
}

.warn {
  background: var(--warn-grad);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.warn:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), 0 0 15px rgba(245, 158, 11, 0.2);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--accent-glow);
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: inline-block;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-group label {
  margin-bottom: 0 !important;
}

small {
  color: var(--muted);
  line-height: 1.6;
  font-size: 12px;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: min(100%, 430px);
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}

.auth-card.wide { width: min(100%, 620px); }
.auth-card h1 { margin: 0; font-size: 32px; }
.auth-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.inline-control { display: flex; gap: 10px; align-items: stretch; }
.inline-control code {
  flex: 1;
  background: #020617;
  border-radius: 8px;
  padding: 12px;
  overflow-wrap: anywhere;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  background: rgba(11, 15, 26, 0.95);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}
.brand h2 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand h2 .badge {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-group {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.sidebar-nav button {
  background: transparent;
  color: #94a3b8;
  justify-content: flex-start;
  padding: 11px 15px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.25s ease;
  box-shadow: none;
}

.sidebar-nav button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: white;
  transform: translateX(4px);
}

.sidebar-nav button.active {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05);
}
.sidebar-nav button.active svg {
  color: #818cf8;
}

.sidebar-promo {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.sidebar-promo::before {
  content: '';
  position: absolute;
  top: -30%; right: -30%;
  width: 70px; height: 70px;
  background: var(--accent);
  filter: blur(40px);
  border-radius: 50%;
  opacity: 0.3;
}
.sidebar-promo strong {
  display: block;
  margin: 8px 0 4px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
}
.sidebar-promo p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.main-content {
  padding: 28px 40px;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  width: 320px;
  transition: all 0.3s ease;
}
.search-wrap:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--accent-glow);
}
.search-wrap svg { color: var(--muted); }
.search-wrap input {
  background: transparent;
  border: none;
  padding: 10px;
  width: 100%;
  backdrop-filter: none;
}
.search-wrap input:focus {
  outline: none;
  box-shadow: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sync-pill.offline {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.icon-btn {
  background: rgba(15, 23, 42, 0.6);
  color: var(--muted);
  padding: 11px;
  border-radius: 50%;
  position: relative;
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.icon-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--danger-grad);
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 2px 4px;
  border-radius: 10px;
  border: 2px solid #030712;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Notification Dropdown Styling */
.notifications-dropdown {
  position: absolute;
  top: 62px;
  right: 0;
  width: 360px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 2px rgba(255, 255, 255, 0.1) inset;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.notif-header h3 {
  margin: 0;
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: white;
}
.notif-header button {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: flex-start;
}
.notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.notif-item.unread {
  background: rgba(99, 102, 241, 0.04);
  border-left: 3px solid var(--accent);
}
.notif-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.notif-item-icon.danger { background: rgba(239, 68, 68, 0.15); color: #fecaca; }
.notif-item-icon.warn { background: rgba(245, 158, 11, 0.15); color: #fef3c7; }
.notif-item-icon.success { background: rgba(16, 185, 129, 0.15); color: #d1fae5; }
.notif-item-icon.info { background: rgba(99, 102, 241, 0.15); color: #e0e7ff; }

.notif-item-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.notif-item-text {
  font-size: 13px;
  line-height: 1.45;
  color: #e2e8f0;
}
.notif-item-text strong {
  font-weight: 700;
  color: white;
}
.notif-item-time {
  font-size: 10px;
  color: var(--muted);
}
.notif-item-dismiss {
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  transition: all 0.2s;
}
.notif-item-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.notif-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-info strong { font-size: 13px; font-weight: 600; color: white; }
.user-info span { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.avatar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a5b4fc;
}

.hidden-mobile { display: flex; }
.mobile-nav { display: none; }

.tabs button {
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tabs button.active {
  color: white;
  border-bottom-color: var(--accent);
}

.tab { display: none; }
.tab.active { display: block; }
.tab h2 { margin-top: 0; }

body[data-role="collector"] .sidebar-nav button {
  display: none;
}
body[data-role="collector"] .sidebar-nav button[data-tab="dashboard"],
body[data-role="collector"] .sidebar-nav button[data-tab="clients"],
body[data-role="collector"] .sidebar-nav button[data-tab="payments"],
body[data-role="collector"] .sidebar-nav button[data-tab="invoices"] {
  display: flex;
}
body[data-role="collector"][data-collector-assigned="true"] .sidebar-nav button[data-tab="new-loan"] {
  display: flex;
}

body[data-role="collector"] .nav-group:nth-of-type(2),
body[data-role="collector"] .nav-group:nth-of-type(3),
body[data-role="collector"] .top-actions #show-installation,
body[data-role="collector"] #filter-collector,
body[data-role="collector"] #loan-collector {
  display: none;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 190px;
  margin-bottom: 20px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.08)),
    rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), var(--glass-glow);
}
.hero-panel span { color: #a5b4fc; font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }
.hero-panel h2 { margin: 8px 0; font-size: 34px; font-weight: 800; color: white; }
.hero-panel p { margin: 0; color: #94a3b8; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stats.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 20px 0; }

.stats article {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats article:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.08);
}

.panel, .notice {
  background: rgba(11, 15, 26, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--glass-glow);
  backdrop-filter: blur(12px);
}

.notice {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.8));
  border-color: rgba(99, 102, 241, 0.15);
}

.stats span { color: var(--muted); display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stats strong { font-size: 26px; font-weight: 800; color: white; font-family: 'Outfit', sans-serif; }

.dashboard-grid, .analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.analytics-grid { grid-template-columns: 1.35fr .85fr; }
.panel.wide { grid-column: span 2; }
.panel h3 { margin: 0 0 14px; font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; color: white; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-heading h3 { margin: 0; }
.panel-heading span, .muted { color: var(--muted); font-size: 13px; }

.health-ring {
  --score: 0%;
  width: 160px;
  height: 160px;
  margin: 12px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent-2) 0 var(--score), rgba(255, 255, 255, 0.05) var(--score) 100%);
  position: relative;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.1), inset 0 0 20px rgba(0, 0, 0, 0.4);
}
.health-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #080b13;
  border: 1px solid var(--line);
}
.health-ring span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 900;
  color: white;
  font-family: 'Outfit', sans-serif;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mini-grid span {
  display: grid;
  gap: 4px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.mini-grid strong { color: white; font-size: 16px; font-weight: 700; font-family: 'Outfit', sans-serif; }

.timeline { display: grid; gap: 10px; }
.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}
.timeline-item:hover {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}
.timeline-item small { display: block; color: var(--muted); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.6); }
.dot.late { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
.dot.done { background: #64748b; box-shadow: none; }

.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  margin: 16px 0 10px;
  border: 1px solid var(--line);
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--success-grad);
  transition: width .35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-title h2 { margin: 0 0 6px; font-size: 26px; }
.section-title p { margin: 0; color: var(--muted); }

.bar-list, .alert-list { display: grid; gap: 12px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
}
.bar-row small { display: block; color: var(--muted); margin-top: 3px; }
.bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar-track span {
  display: block;
  height: 100%;
  background: var(--accent-grad);
  border-radius: inherit;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}
.donut {
  width: 180px;
  height: 180px;
  margin: 8px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  background: #080b13;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.donut span {
  z-index: 1;
  font-size: 28px;
  font-weight: 800;
  color: white;
  font-family: 'Outfit', sans-serif;
}
.legend { display: grid; gap: 8px; }
.legend span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend .green { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.legend .red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.legend .gray { background: #64748b; box-shadow: none; }

.projection-bars {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
}
.projection-col {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}
.projection-fill {
  align-self: end;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #22c55e, #0f766e);
  min-height: 8px;
}
.projection-col strong { color: white; font-size: 13px; }
.projection-col span { font-size: 12px; }
.alert {
  border-left: 4px solid #16a34a;
  background: #172033;
  border-radius: 8px;
  padding: 12px;
  color: #dbeafe;
}
.alert.danger { border-left-color: #dc2626; }
.alert.warn { border-left-color: #ca8a04; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.settings-grid .panel {
  display: grid;
  gap: 10px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.loan-help {
  margin: 0 0 14px;
}
.invite-panel {
  margin-bottom: 14px;
}
.admin-grid, .plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.plans-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.plan-card {
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.plan-card.featured {
  border-color: #22c55e;
  box-shadow: 0 18px 60px rgba(34, 197, 94, .12);
}
.plan-card span {
  color: #99f6e4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.plan-card h3 {
  margin: 0;
  font-size: 30px;
}
.plan-card p {
  margin: 0;
  color: var(--muted);
}
.plan-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.plan-status span {
  display: grid;
  gap: 4px;
  background: #172033;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}
.plan-status strong { color: white; }
.code-block {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #bfdbfe;
}

.mobile-hero {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .35), rgba(79, 70, 229, .18)),
    #111827;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 12px;
}
.mobile-hero span {
  color: #99f6e4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.mobile-hero h2 {
  margin: 8px 0 4px;
  font-size: 36px;
}
.mobile-hero p { margin: 0; color: var(--muted); }
.mobile-search { margin-bottom: 12px; }
.mobile-list {
  display: grid;
  gap: 10px;
}
.mobile-client-card {
  display: grid;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.mobile-client-card strong {
  display: block;
  font-size: 18px;
}
.mobile-client-card span {
  color: var(--muted);
  font-size: 13px;
}
.mobile-client-card b {
  font-size: 24px;
}
.mobile-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.toolbar, .payment-row {
  display: grid;
  grid-template-columns: 2fr 150px 180px 150px 150px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td {
  padding: 12px;
  border-bottom: 1px solid #273449;
  text-align: left;
  vertical-align: middle;
}
th { position: sticky; top: 0; background: #172033; color: #cbd5e1; z-index: 1; }
td.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.badge.ok { background: #064e3b; color: #86efac; }
.badge.late { background: #7f1d1d; color: #fecaca; }
.badge.done { background: #334155; color: #cbd5e1; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.search-box { position: relative; min-width: 280px; }
.results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  background: #172033;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.results button {
  width: 100%;
  background: transparent;
  justify-content: flex-start;
  border-radius: 0;
  border-bottom: 1px solid #273449;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.redito-payment-help {
  display: grid;
  gap: 4px;
  min-width: 240px;
  padding: 10px 12px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #0f1f3a;
}
.redito-payment-help span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dbeafe;
  font-size: 13px;
}
.redito-payment-help small {
  color: #bfdbfe;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.tag button { padding: 2px 6px; border-radius: 50%; background: rgba(255,255,255,.14); color: white; border: 0; cursor: pointer; font-size: 10px; margin-left: 2px; }
.tag button:hover { background: rgba(239, 68, 68, 0.3); }

/* Premium Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

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

.modal-card {
  position: relative;
  width: min(100%, 460px);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--accent-glow);
  backdrop-filter: blur(12px);
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card.large { width: min(100%, 1050px); }

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.close:hover {
  background: var(--danger-grad);
  border-color: transparent;
  color: white;
  transform: rotate(90deg);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
  margin: 14px 0 24px;
}
.week-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.25s ease;
}
.week-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.65);
}
.week-card.paid {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.03);
}
.week-card.principal-card {
  border-color: rgba(13, 148, 136, 0.3);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(15, 23, 42, 0.4) 100%);
}
.week-card.principal-card small {
  display: block;
  margin-top: 8px;
  color: #2dd4bf;
}
.history { display: grid; gap: 8px; }
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.bank-box {
  display: grid;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  background: var(--success-grad);
  color: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 15px rgba(16, 185, 129, 0.3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInLeft {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.error {
  background: var(--danger-grad);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 15px rgba(239, 68, 68, 0.3);
}

/* FAB Quick Actions for Mobile */
.fab-container {
  display: none;
  position: fixed;
  bottom: 84px;
  right: 20px;
  z-index: 1500;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), var(--accent-glow);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}
.fab-main svg {
  transition: transform 0.3s ease;
}
.fab-container.active .fab-main {
  background: var(--danger-grad);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}
.fab-container.active .fab-main svg {
  transform: rotate(135deg);
}

.fab-menu {
  position: absolute;
  bottom: 68px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.fab-container.active .fab-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  text-decoration: none;
  cursor: pointer;
}
.fab-label {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.fab-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  padding: 0;
}
.fab-btn:hover {
  background: var(--accent-grad);
  color: white;
  border-color: transparent;
  transform: scale(1.08);
}

/* Custom Mobile Client & Invoice Cards */
.mobile-client-cards-grid, .mobile-invoice-cards-grid {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.premium-mobile-card {
  background: rgba(11, 15, 26, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  transition: all 0.25s;
}
.premium-mobile-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.card-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-client-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  font-family: 'Outfit', sans-serif;
}
.card-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.card-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 10px;
}
.card-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-detail-item label {
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}
.card-detail-item span {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}
.card-detail-item span.highlight-number {
  font-size: 14px;
  font-weight: 700;
  color: white;
  font-family: 'Outfit', sans-serif;
}

.card-actions-row {
  display: flex;
  gap: 8px;
}
.card-actions-row button, .card-actions-row .button {
  flex: 1;
  padding: 8px 10px;
  font-size: 11px;
  min-height: 36px;
}

#print-area { display: none; }

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #0f172a; background: white; padding: 0; font-family: 'Outfit', -apple-system, BlinkMacSystemFont, Arial, sans-serif; }
  
  .receipt-page {
    width: 680px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    box-sizing: border-box;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 20px;
  }
  
  .receipt-brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .receipt-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
  }
  .receipt-brand-text h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
  }
  .receipt-brand-text p {
    font-size: 11px;
    color: #64748b;
    margin: 2px 0 0 0;
    text-transform: uppercase;
    font-weight: 600;
  }
  
  .receipt-number-box {
    text-align: right;
  }
  .receipt-number-box .label {
    display: block;
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.05em;
  }
  .receipt-number-box .number {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0;
  }
  .receipt-number-box .date {
    display: block;
    font-size: 11px;
    color: #64748b;
  }
  
  .receipt-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
  }
  
  .info-block h3 {
    font-size: 10px;
    color: #64748b;
    margin: 0 0 6px 0;
    letter-spacing: 0.05em;
    font-weight: 700;
  }
  .info-block strong {
    font-size: 15px;
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
  }
  .info-block p {
    font-size: 12px;
    color: #475569;
    margin: 3px 0;
  }
  
  .receipt-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin-bottom: 24px;
    table-layout: auto;
  }
  .receipt-table th,
  .receipt-table td {
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .receipt-table th {
    position: static !important;
    background: #f1f5f9 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    color: #475569 !important;
    text-transform: uppercase;
    font-weight: 700;
  }
  .receipt-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 10px 12px;
    font-size: 13px;
    color: #334155 !important;
  }
  .receipt-table .text-right {
    text-align: right !important;
  }
  .receipt-table .highlight-row td {
    background: #f8fafc !important;
    border-top: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 700;
  }
  .receipt-table .info-row td {
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-weight: 600;
  }
  
  .receipt-footer {
    text-align: center;
    border-top: 2px dashed #e2e8f0;
    padding-top: 16px;
    margin-top: 16px;
  }
  .receipt-footer p {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px 0;
  }
  .receipt-footer small {
    font-size: 10px;
    color: #64748b;
    display: block;
  }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 0; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .top-actions { justify-content: flex-end; width: 100%; }
  .hidden-mobile { display: none; }
  .stats, .stats.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { align-items: flex-start; flex-direction: column; }
  .hero-panel h2 { font-size: 28px; }
  .dashboard-grid, .analytics-grid, .settings-grid { grid-template-columns: 1fr; }
  .admin-grid, .plans-grid, .plan-status { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
  .bar-row { grid-template-columns: 1fr; }
  .toolbar, .payment-row { grid-template-columns: 1fr; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .notice { flex-direction: column; align-items: stretch; }
  
  /* Show Mobile Cards Instead of Scrolling Tables */
  #clients .table-shell, #invoices .table-shell {
    display: none !important;
  }
  .mobile-client-cards-grid, .mobile-invoice-cards-grid {
    display: flex !important;
  }
  
  /* Show Mobile Floating FAB Menu */
  .fab-container {
    display: block !important;
  }
}

@media (max-width: 640px) {
  body {
    background: #030712;
    background-image: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  }
  button, .button { min-height: 42px; padding: 8px 12px; }
  input, select, textarea { min-height: 44px; font-size: 15px; padding: 10px 12px; }
  .main-content {
    padding: 10px 10px 92px;
    width: 100%;
  }
  .auth-card {
    padding: 18px 20px !important;
    gap: 12px !important;
  }
  .auth-card h1 {
    font-size: 26px !important;
  }
  .auth-card p {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin: -10px -10px 16px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .topbar h1 { font-size: 20px; font-family: 'Outfit', sans-serif; }
  
  .top-actions {
    width: auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
  }
  .top-actions .sync-pill {
    margin-right: 0;
  }
  .tabs {
    display: none;
  }
  
  /* Premium Floating Dock Bottom Navigation Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 14px; 
    left: 14px; 
    right: 14px;
    z-index: 1400;
    background: rgba(11, 15, 26, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1) inset;
    gap: 4px;
  }
  .mobile-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: #64748b;
    border-radius: 12px;
    font-size: 10px;
    padding: 8px 0;
    font-weight: 600;
    border: none;
    box-shadow: none;
    transition: all 0.25s ease;
    min-height: auto;
  }
  .mobile-nav button:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
    color: white;
  }
  .mobile-nav button.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.12);
  }
  .mobile-nav button.active svg {
    color: #a5b4fc;
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.4));
  }
  
  .hero-panel {
    min-height: auto;
    padding: 18px;
  }
  .hero-panel h2,
  .mobile-hero h2 {
    font-size: 28px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stats article,
  .panel,
  .notice {
    padding: 14px;
  }
  .stats strong { font-size: 22px; }
  .dashboard-grid { gap: 12px; }
  .health-ring {
    width: 132px;
    height: 132px;
  }
  .health-ring span { font-size: 24px; }
  .toolbar {
    position: sticky;
    top: 68px;
    z-index: 90;
    background: #030712;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }
  .table-shell {
    border: 0;
    background: transparent;
  }
  table {
    min-width: 100%;
    font-size: 13px;
  }
  th, td { padding: 9px; }
  .payment-row {
    gap: 10px;
  }
  .payment-row button,
  #print-last-invoice {
    width: 100%;
  }
  .modal {
    align-items: flex-end;
    padding: 0;
    background: rgba(3, 7, 18, 0.7);
  }
  .modal-card {
    width: 100%;
    max-height: 84vh;
    border-radius: 16px 16px 0 0;
    padding: 22px 16px;
    margin-bottom: 0;
    border-bottom: none;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-card-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  /* Positioning Adjustments for Floating elements */
  .fab-container {
    bottom: 88px;
    right: 16px;
  }
  .toast {
    top: auto;
    bottom: 94px;
    left: 16px;
    right: 16px;
    width: auto;
    justify-content: center;
    animation: slideInBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideInBottom {
    from { transform: translateY(150%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  body[data-role="collector"] .tabs button[data-tab="dashboard"],
  body[data-role="collector"] .tabs button[data-tab="clients"],
  body[data-role="collector"][data-collector-assigned="true"] .tabs button[data-tab="new-loan"],
  body[data-role="collector"] .tabs button[data-tab="payments"],
  body[data-role="collector"] .tabs button[data-tab="collector-mobile"] {
    display: block;
  }
  body[data-role="collector"] .top-actions #export-backup,
  body[data-role="collector"] .top-actions label,
  body[data-role="collector"] .top-actions #open-donation,
  body[data-role="collector"] .top-actions #show-installation {
    display: none;
  }
  
  /* Mobile specific dropdown styles */
  .notifications-dropdown {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    max-height: 70vh !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    z-index: 2000 !important;
  }
  
  /* Mobile specific more menu grid */
  .more-menu-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* Role-based administrative elements visibility */
body[data-role="collector"] .admin-only {
  display: none !important;
}

/* More Menu Tab Grid */
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.more-menu-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.more-menu-card:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 10px rgba(99, 102, 241, 0.1);
}
.more-menu-card:active {
  transform: translateY(0);
  background: rgba(15, 23, 42, 0.95);
}
.more-menu-card .card-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.more-menu-card .card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.more-menu-card .card-text strong {
  font-size: 15px;
  font-weight: 700;
  color: white;
  font-family: 'Outfit', sans-serif;
}
.more-menu-card .card-text span {
  font-size: 11.5px;
  color: #94a3b8;
}
