:root {
  --white: #ffffff;
  --text: #0f172a;
  --blue: #2b8df5;
  --blue-hover: #1f74d1;
  --light: #eef6ff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
html, body {
  height: 100%;
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.hero {
  background: linear-gradient(135deg, var(--blue), #6fb6ff);
  color: var(--white);
  position: relative;
  padding: 32px 16px 64px;
  text-align: center;
}
.hero-logo {
  display: none;
  width: 140px;
  max-height: 80px;
  object-fit: contain;
  margin: 0 auto 12px;
}
.hero-inner h1 { margin: 0 0 8px; }
.hero .curve {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
}
.hero .curve path {
  fill: var(--white);
}
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}
.card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #e6eef8;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wrap {
  flex-wrap: wrap;
}
.space-between {
  justify-content: space-between;
}
.header-bar h2 {
  margin: 0;
}
.input {
  border: 1px solid #cfe3ff;
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  background: var(--light);
  min-width: 160px;
  box-sizing: border-box;
}
.input-wide {
  flex: 1;
}
.combo-field {
  position: relative;
}
.combo-input-wrap {
  position: relative;
}
.combo-input {
  width: 100%;
  min-width: 0;
  padding-right: 46px;
}
.combo-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 1px solid #d8e6fb;
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}
.combo-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  border: 1px solid #e6eef8;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}
.combo-option {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d8e6fb;
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.combo-option:hover {
  background: var(--light);
}
.combo-empty {
  padding: 8px 10px;
  color: #64748b;
  font-size: 13px;
}
.filters .filter-left {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filters .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters .filter-group .input {
  min-width: 140px;
}
.btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { background: var(--blue-hover); }
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-outline:hover {
  background: var(--light);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
}
.table thead th {
  background: var(--light);
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.align-right {
  text-align: right;
}
.actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.menu {
  position: relative;
  display: inline-block;
}
.menu-btn {
  border: 1px solid #cfe3ff;
  background: var(--light);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  border: 1px solid #e6eef8;
  border-radius: 10px;
  min-width: 96px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
  z-index: 10;
}
.menu-panel-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.menu-item {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d8e6fb;
  border-radius: 8px;
  background: var(--white);
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.menu-item:hover {
  background: var(--light);
}
.menu-item.danger {
  color: var(--danger);
  border-color: #fecaca;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 6px;
  font-weight: 600;
}
.muted {
  margin: 4px 0 0;
  color: #64748b;
}
.dashboard-controls {
  align-items: flex-end;
}
.control-label {
  font-size: 13px;
  color: #334155;
}
.dashboard-tabs {
  gap: 8px;
}
.tab-btn {
  min-width: 150px;
}
.tab-btn.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 12px;
  color: #475569;
}
.kpi-value {
  font-size: 20px;
  color: #0f172a;
}
.section-subtitle {
  margin: 0 0 10px;
}
.error-text {
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 600;
}
body.auth-body {
  background: radial-gradient(circle at top, #0b3b76 0%, #0b1220 60%, #070b14 100%);
  color: #f8fafc;
}
body.auth-body .hero {
  display: none;
}
body.auth-body .container {
  max-width: 100%;
  padding: 0;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1fr);
  gap: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  padding: 32px;
  backdrop-filter: blur(16px);
}
.auth-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Space Grotesk', sans-serif;
}
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}
.auth-logo {
  width: 180px;
  max-width: 70%;
  height: auto;
  object-fit: contain;
}
.logo-preview {
  margin-top: 12px;
}
.logo-preview-img {
  width: 200px;
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 36px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.2);
  color: #e0f2fe;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}
.auth-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  color: #f8fafc;
}
.auth-subtitle {
  margin: 0;
  color: #cbd5f5;
  font-size: 16px;
}
.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.auth-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 12px;
  color: #e2e8f0;
}
.auth-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  font-family: 'Space Grotesk', sans-serif;
}
.auth-form h2 {
  margin: 0 0 6px;
}
.auth-form .form-grid {
  grid-template-columns: 1fr;
}
.auth-form .input {
  width: 100%;
  background: #f8fafc;
}
.auth-actions {
  margin-top: 16px;
}
.auth-submit {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
}
.auth-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-switch {
  border-radius: 999px;
}
.auth-logged h2 {
  margin: 0 0 8px;
}
.workspace-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  position: relative;
}
.workspace-sidebar {
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 12px;
  min-height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
}
.workspace-sidebar h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.sidebar-main {
  overflow-y: auto;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #dbeafe;
}
.sidebar-logout {
  width: 100%;
}
.sidebar-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #dbeafe;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.sidebar-link.active {
  border-color: var(--blue);
  background: var(--light);
  color: var(--blue);
  font-weight: 600;
}
.workspace-main {
  min-width: 0;
}
.hamburger-btn {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #bfd8ff;
  background: #fff;
  color: #0f172a;
  font-size: 20px;
  cursor: pointer;
}
.chart-stack {
  display: grid;
  gap: 10px;
}
.chart-row {
  display: grid;
  gap: 6px;
}
.chart-label {
  font-size: 13px;
  color: #334155;
}
.chart-bar-wrap {
  background: #eff6ff;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  min-height: 28px;
  border: 1px solid #dbeafe;
}
.chart-bar {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  min-height: 28px;
}
.chart-value {
  position: absolute;
  right: 10px;
  top: 6px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.member-item {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.checkbox-row {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .auth-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .auth-switch {
    width: 100%;
  }
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .workspace-sidebar {
    display: none;
    position: fixed;
    left: 10px;
    right: 10px;
    top: 10px;
    z-index: 40;
    max-height: 80vh;
    min-height: 0;
    overflow-y: auto;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
  }
  .workspace-sidebar.open {
    display: block;
  }
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn, .btn-outline {
    width: 100%;
  }
  .input {
    width: 100%;
  }
  .input-wide {
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
  }
}
