﻿:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #121420;
  --muted: #4a4f63;
  --line: #dfe3ec;
  --accent: #1b8f2f;
  --accent-strong: #177a28;
  --danger: #d32020;
  --shadow: 0 8px 18px rgba(18, 20, 32, 0.06);
}

* { box-sizing: border-box; }
html {
  font-size: 95%;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.bg-orb,
.orb-a,
.orb-b { display: none; }

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.layout-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.global-sidebar {
  background: #171717;
  color: #fff;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #171717;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-text {
  font-size: 1.0rem;
  font-weight: 500;
}

.menu-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fb2de;
  margin: 0 0 10px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  text-decoration: none;
  color: #ffffff;
  padding: 12px 14px;
  font-size: 0.94rem;
  border: 1px solid transparent;
}

.side-link .bi {
  font-size: 18px;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.side-link.active {
  background: #d8dfdf;
  color: #129b39;
  border-color: #2dd65f;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
}

.side-logout {
  margin-top: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.08);
}

.content-shell {
  padding: 0 0 18px;
}

.top-strip {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top-strip-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.bolt {
  color: #28b34b;
  font-size: 1rem;
}

.powered {
  font-weight: 600;
  color: #162844;
}

.top-link {
  color: #3d6bd8;
  text-decoration: none;
  font-weight: 500;
}

.top-link:hover {
  text-decoration: underline;
}

.top-strip-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: right;
  line-height: 1.1;
  font-size: 0.9rem;
}

.signed-in-email {
  font-weight: 400;
  color: #1f2e47;
}

.signed-in-block {
  display: flex;
  flex-direction: column;
}



.top-profile-link {
  color: #1f2e47;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.top-profile-link:hover {
  background: #eef2f8;
}

.content-header {
  margin: 12px 18px 0;
  padding: 14px 16px;
}

.greeting-header {
  margin: 12px 18px 0;
  padding: 6px 0;
}

.greeting-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f1f39;
}

.dashboard-greeting-subtitle {
  margin: 8px 0 0;
  color: #5b6d84;
  font-size: 1.02rem;
}

.content-shell .panel {
  margin: 14px 18px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-view {
  max-width: 460px;
  margin: 56px auto;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(18, 20, 32, 0.1);
}

.auth-view h1 {
  margin: 0 0 4px;
}

.auth-view .muted {
  margin: 0 0 12px;
}

h1, h2, h3 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 500; }
input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

input[readonly] {
  background: #edf0f4;
  color: #6f7b8f;
  border-color: #e3e8f0;
  cursor: not-allowed;
}

button { font: inherit; }
.btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.pastel-blue {
  background: #e9f3ff;
  border-color: #bdd9f6;
  color: #356d9b;
}
.btn.pastel-blue:hover {
  background: #dcecff;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.badge {
  border-radius: 999px;
  background: #e8f6eb;
  color: var(--accent);
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav {
  margin-top: 14px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-btn.active { background: #e8f6eb; border-color: #b9dfc1; color: var(--accent); font-weight: 700; }

.panel { margin-top: 14px; }
.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.metric { padding: 14px; }
.metric h3 {
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.metric p { font-size: 1.4rem; font-weight: 700; margin: 2px 0 0; }

.charts-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chart-card {
  padding: 12px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.suppliers-card {
  grid-column: 1 / -1;
}
.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 300px !important;
  min-height: 300px;
}

.toolbar {
  padding: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input[type="search"] { max-width: 360px; }
.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}
.inline-filter input[type="date"] {
  width: auto;
  min-width: 150px;
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  font-size: 0.95rem;
}
tr:hover td { background: var(--surface-soft); }
.action-row { display: flex; gap: 6px; flex-wrap: wrap; }
.link-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.link-btn.danger { color: var(--danger); }
.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bi {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

.settings-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px 12px;
}
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.tab-btn { flex: 1; }
.tab-btn.active { background: #e8f6eb; color: var(--accent); border-color: #b9dfc1; font-weight: 700; }
.auth-message { min-height: 20px; margin: 0; color: var(--danger); }
.auth-terms {
  margin: 2px 0 0;
  font-size: 0.87rem;
  line-height: 1.45;
  color: var(--muted);
}
.auth-terms a {
  color: #3d6bd8;
  text-decoration: none;
}
.auth-terms a:hover {
  text-decoration: underline;
}

.modal {
  width: min(720px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface);
}
.modal::backdrop { background: rgba(10, 20, 40, 0.5); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.invoice-modal-form {
  font-weight: 400;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.invoice-modal-form h3,
.invoice-modal-form p,
.invoice-modal-form button,
.invoice-modal-form input {
  font-weight: 400;
}

.invoice-modal-form label {
  font-weight: 700;
}

.invoice-modal-form .btn {
  font-weight: 400;
}

.invoice-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.invoice-modal-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.invoice-modal-title .bi {
  color: var(--accent);
}

.invoice-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.invoice-modal-footer-right {
  display: inline-flex;
  gap: 8px;
}

.invoice-modal-form .auth-message {
  grid-column: 1 / -1;
}

.invoice-modal-form .field-100 {
  grid-column: span 4;
}

.invoice-modal-form .field-50 {
  grid-column: span 2;
}

.invoice-modal-form .field-50-alone {
  grid-column: span 2;
}

.invoice-modal-form .field-break {
  grid-column: 1 / -1;
  height: 0;
}

.invoice-modal-form .field-25 {
  grid-column: span 1;
}

#deleteInvoiceBtn {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--danger);
}

#deleteInvoiceBtn:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--danger);
}

.image-modal img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  max-height: 70vh;
  object-fit: contain;
  background: var(--surface-soft);
}

.play-badge-link {
  display: inline-block;
  margin-top: 10px;
}

.play-badge-image {
  width: 190px;
  height: auto;
  display: block;
}

.hidden { display: none !important; }

@media (max-width: 720px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }
  .global-sidebar {
    border-right: 0;
    border-bottom: 1px solid #1a2f63;
    padding: 14px 12px;
  }
  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .side-link {
    justify-content: center;
    font-size: 0.92rem;
    padding: 10px 8px;
  }
  .side-link .bi {
    display: none;
  }
  .sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
}
  .content-shell {
    padding: 0 0 12px;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .suppliers-card {
    grid-column: auto;
  }
  .top-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 12px;
  }
  .top-strip-right {
    text-align: left;
    justify-content: flex-start;
  }
  .content-header {
    margin: 10px 12px 0;
  }
  .content-shell .panel {
    margin: 12px 12px 0;
  }
  .invoice-modal-form {
    grid-template-columns: 1fr;
  }
  .invoice-modal-form .field-100,
  .invoice-modal-form .field-50,
  .invoice-modal-form .field-25 {
    grid-column: 1 / -1;
  }
  .topbar { align-items: flex-start; flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
}
