/* ═══════════════════════════════════════════
   Apartman Admin – Global Stylesheet
   ═══════════════════════════════════════════ */

/* --- Design tokens --- */
:root {
  --sea: #1a6b7a;
  --sea-dark: #104f5c;
  --sea-light: #e8f4f6;
  --sand: #e8dcc8;
  --sand-dark: #c9b99a;
  --stone: #7c6f5e;
  --terracotta: #c0572a;
  --terracotta-light: #f5e8e2;
  --surface: #faf8f4;
  --white: #ffffff;
  --input-bg: #ffffff;
  --card-bg: #fdfcf9;
  --btn-surface: #f2f9fa;
  --text: #2c2416;
  --text-muted: #8a7968;
  --border: #e0d8cc;
  --radius: 6px;
}

/* --- Themes --- */
body.theme-ocean-blue {
  --sea: #1e6fa0; --sea-dark: #174f73; --sea-light: #e6f1f8;
  --sand: #c8dbe8; --sand-dark: #9bb8cf; --stone: #5a7a8f;
  --terracotta: #c0572a; --terracotta-light: #f5e8e2;
  --surface: #f5f9fc; --white: #ffffff; --input-bg: #f9fcfe;
  --btn-surface: #edf5fa; --text: #1a2e3a; --text-muted: #6b8a9d;
  --border: #d0dfe8;
}
body.theme-olive-grove {
  --sea: #5f7a3e; --sea-dark: #445a2c; --sea-light: #eef3e8;
  --sand: #d6d4b0; --sand-dark: #b5b38a; --stone: #7a7660;
  --terracotta: #b06428; --terracotta-light: #f5eddf;
  --surface: #f9f8f2; --white: #ffffff; --input-bg: #fcfbf5;
  --btn-surface: #f2f3ea; --text: #2a2a1e; --text-muted: #8a8670;
  --border: #dddacc;
}
body.theme-sunset-warm {
  --sea: #c06930; --sea-dark: #994f20; --sea-light: #fdf0e6;
  --sand: #f0d8b0; --sand-dark: #d4b87a; --stone: #8a7050;
  --terracotta: #d04830; --terracotta-light: #fce8e4;
  --surface: #fdf8f2; --white: #ffffff; --input-bg: #fefbf6;
  --btn-surface: #faf2ea; --text: #3a2816; --text-muted: #9a7a5e;
  --border: #e8d8c4;
}
body.theme-midnight {
  --sea: #60a0c0; --sea-dark: #4080a0; --sea-light: rgba(96,160,192,0.12);
  --sand: #3a4550; --sand-dark: #2a3540; --stone: #8090a0;
  --terracotta: #e07050; --terracotta-light: rgba(224,112,80,0.15);
  --surface: #1a1e24; --white: #242a32; --input-bg: #2a3038;
  --btn-surface: #2e3640; --text: #e0e4e8; --text-muted: #8898a8;
  --border: #3a4250;
}
body.theme-midnight th { color: #e0e4e8; }
body.theme-midnight tbody tr:hover { background: rgba(96,160,192,0.08); }
body.theme-midnight .sidebar { background: #12161a; }
body.theme-lavender {
  --sea: #7c5cbf; --sea-dark: #5c3ea0; --sea-light: #f1ecf9;
  --sand: #d8cfe8; --sand-dark: #b8a8d0; --stone: #7a6f8e;
  --terracotta: #c05a7a; --terracotta-light: #f8e8ef;
  --surface: #f9f7fc; --white: #ffffff; --input-bg: #fcfaff;
  --btn-surface: #f4f0fa; --text: #2a2036; --text-muted: #8878a0;
  --border: #e0d8ec;
}
body.theme-nordic {
  --sea: #5a6a7a; --sea-dark: #3e4e5e; --sea-light: #eef1f4;
  --sand: #d0d4d8; --sand-dark: #b0b6bc; --stone: #7a828c;
  --terracotta: #b04a3a; --terracotta-light: #f5e8e4;
  --surface: #f5f6f7; --white: #ffffff; --input-bg: #fafbfc;
  --btn-surface: #f0f1f3; --text: #1e2428; --text-muted: #7a838e;
  --border: #d8dce0;
}
body.theme-forest {
  --sea: #2a6e4a; --sea-dark: #1a4e32; --sea-light: #e4f2eb;
  --sand: #b8ccb0; --sand-dark: #90aa84; --stone: #5e7a60;
  --terracotta: #c06028; --terracotta-light: #f5ede2;
  --surface: #f3f7f4; --white: #ffffff; --input-bg: #f8faf8;
  --btn-surface: #ecf3ee; --text: #1a2a1e; --text-muted: #6a8a6e;
  --border: #ccdcce;
}
body.theme-coral {
  --sea: #d06070; --sea-dark: #b04858; --sea-light: #fceef0;
  --sand: #f0d0c8; --sand-dark: #daa898; --stone: #8a6a6e;
  --terracotta: #c04030; --terracotta-light: #fce4e0;
  --surface: #fdf6f6; --white: #ffffff; --input-bg: #fefaf9;
  --btn-surface: #faf0ee; --text: #3a1e20; --text-muted: #a06a70;
  --border: #ecd4d0;
}
body.theme-slate {
  --sea: #4a6580; --sea-dark: #344a60; --sea-light: #e8eef3;
  --sand: #c0c8d0; --sand-dark: #9aa4b0; --stone: #6a7888;
  --terracotta: #b85040; --terracotta-light: #f5e4e0;
  --surface: #f4f5f7; --white: #ffffff; --input-bg: #f9fafb;
  --btn-surface: #edf0f3; --text: #1e2430; --text-muted: #728090;
  --border: #d0d6dc;
}
body.theme-espresso {
  --sea: #6a4a32; --sea-dark: #4a3220; --sea-light: #f2ebe4;
  --sand: #d8c4a8; --sand-dark: #bca480; --stone: #7a6850;
  --terracotta: #c06030; --terracotta-light: #f5ebe0;
  --surface: #f8f4ee; --white: #ffffff; --input-bg: #fcfaf6;
  --btn-surface: #f4efe8; --text: #2c2016; --text-muted: #8a7460;
  --border: #e0d4c4;
}

/* --- Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
}

/* --- Layout --- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; overflow: auto; padding: 2rem 2.5rem; max-width: 1000px; }
.main a:not(.btn) { color: var(--sea); text-decoration: none; transition: color 0.15s ease; }
.main a:not(.btn):hover { color: var(--text); }

/* --- Sidebar --- */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--sea-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'%3E%3Cpath d='M0,40 C50,20 100,60 150,40 C200,20 250,60 300,40 C350,20 400,50 400,40 L400,80 L0,80 Z' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") bottom/cover no-repeat;
  pointer-events: none;
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo span {
  display: block;
  font-size: 0.62rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
}
.sidebar-user .user-icon { width: 14px; height: 14px; opacity: 0.5; flex-shrink: 0; }
.sidebar-user .user-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-section {
  padding: 0.6rem 0 0.2rem 1.25rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.sidebar nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 0.5rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 1.25rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.sidebar nav a .icon { width: 14px; height: 14px; opacity: 0.6; flex-shrink: 0; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar nav a.active { color: #fff; background: rgba(255,255,255,0.12); border-left-color: var(--sand); font-weight: 500; }
.sidebar-footer {
  margin-top: auto;
  padding: 0.5rem 0 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
}
.sidebar-footer .footer-section-label {
  padding: 0.6rem 0 0.2rem 1.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.sidebar-footer a, .sidebar-footer button.footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: all 0.15s;
}
.sidebar-footer a:hover, .sidebar-footer button.footer-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar-footer .icon { width: 14px; height: 14px; opacity: 0.6; flex-shrink: 0; }

/* --- Page header --- */
.page-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.page-header h1 { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.page-header p { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.25rem; }

/* --- Stats grid --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sea); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.stat-value { font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 500; color: var(--text); letter-spacing: -0.02em; }

/* --- Alerts --- */
.alert { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; border: 1px solid; }
.alert.success { background: #e8f4e8; border-color: #7cb87c; color: #2d5a2d; }
.alert.warning { background: #fdf7ee; border-color: #e6c87a; color: #7a5c1a; }
.alert.danger { background: var(--terracotta-light); border-color: #e0a090; color: #8c3318; }
.alert-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.alert strong { font-weight: 600; }
.alert p { font-size: 0.85rem; margin-top: 0.2rem; }

/* --- Form validation --- */
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: #8c3318 !important; box-shadow: 0 0 0 2px rgba(140, 51, 24, 0.15);
}

/* --- Charts --- */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.chart-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.chart-card h3 { font-family: 'Fraunces', serif; font-size: 0.95rem; font-weight: 500; color: var(--text); margin-bottom: 1.25rem; }
.gauge-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto 0.75rem; }
.gauge-wrap svg { transform: rotate(-90deg); }
.gauge-bg { stroke: var(--border); fill: none; }
.gauge-fill { stroke: var(--sea); stroke-linecap: round; fill: none; transition: stroke-dashoffset 0.5s ease; }
.gauge-fill.near-limit { stroke: #c9922a; }
.gauge-fill.over-limit { stroke: var(--terracotta); }
.gauge-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.gauge-value .pct { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 500; color: var(--text); line-height: 1; }
.gauge-value small { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.gauge-limit-label { text-align: center; font-size: 0.75rem; color: var(--text-muted); }
.pie-wrap { width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 1rem; }
.pie-legend { list-style: none; font-size: 0.82rem; color: var(--text-muted); }
.pie-legend li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.pie-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* --- Cards --- */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.card-header h2 { font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 500; color: var(--text); }
.card-body { padding: 1.5rem; background: var(--card-bg, #f4f0e8); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border); }
th {
  font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--white); background: var(--sea); cursor: pointer; user-select: none; white-space: nowrap;
}
th:hover { background: var(--sea-dark); }
th .sort-icon { opacity: 0.6; margin-left: 0.2rem; font-size: 0.6rem; }
th.sorted-asc .sort-icon::after { content: ' ▲'; }
th.sorted-desc .sort-icon::after { content: ' ▼'; }
thead .filter-row th { padding: 0.3rem 0.75rem; background: var(--sea-dark); }
.filter-input {
  width: 100%; padding: 0.3rem 0.5rem; font-size: 0.78rem;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 4px;
  background: rgba(255,255,255,0.92); color: var(--text); font-family: 'DM Sans', sans-serif;
}
.filter-input::placeholder { color: #aaa; }
.filter-input:focus { outline: none; border-color: var(--sand); }
tbody tr:hover { background: var(--sea-light); }
tbody tr.filtered-out { display: none; }
td { font-size: 0.88rem; color: var(--text); }
td a { color: var(--sea); text-decoration: none; font-weight: 500; transition: color 0.15s ease; }
td a:hover { color: var(--text); }

/* --- Utility classes --- */
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-error { color: var(--terracotta); font-size: 0.85rem; }
tfoot td { background: var(--surface); font-weight: 600; font-size: 0.88rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; font-size: 0.85rem; font-family: 'DM Sans', sans-serif; font-weight: 500;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-primary { background: var(--sea); color: #fff; border-color: var(--sea); }
.btn-primary:hover { background: var(--sea-dark); }
.btn-secondary { background: var(--btn-surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--sea-light); border-color: var(--sea); }
.btn-loading-spinner {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.15em; margin-right: 0.35rem;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
.btn-loading-spinner svg { display: block; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 500; color: var(--sea); margin-bottom: 0.35rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-group .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="password"], input[type="file"], input[type="url"], input[type="time"], select {
  width: 100%; max-width: 340px; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  width: 100%; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgba(26, 107, 122, 0.12); }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
.form-actions { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; }
.divider { margin: 2.5rem 0; border: none; border-top: 1px solid var(--border); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }

/* --- Invoice items --- */
.invoice-items { margin-top: 0.5rem; }
.invoice-items .item-row {
  display: grid; grid-template-columns: 2fr 60px 90px 80px auto auto;
  gap: 0.6rem; align-items: center; margin-bottom: 0.75rem;
}
.invoice-items .item-row input { max-width: none; }
.add-row { color: var(--sea); font-size: 0.85rem; cursor: pointer; background: none; border: none; font-family: 'DM Sans', sans-serif; padding: 0; margin-top: 0.25rem; }
.add-row:hover { text-decoration: underline; }

/* --- Auth --- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.auth-card h1 { font-family: 'Fraunces', serif; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--text); }
.auth-card .form-group { margin-bottom: 1rem; }
.auth-card .form-group label { text-transform: none; font-size: 0.9rem; }
.auth-card input { max-width: none; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }
.auth-card .auth-link { margin-top: 1rem; font-size: 0.88rem; color: var(--text-muted); }
.auth-card .auth-link a { color: var(--sea); text-decoration: none; }
.auth-divider { margin: 1.25rem 0; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ''; display: inline-block; vertical-align: middle; width: 4rem; height: 1px; background: var(--border); margin: 0 0.5rem; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.5rem 1rem; font-size: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); cursor: pointer; font-family: inherit; text-decoration: none; margin-top: 0.5rem; }
.btn-google:hover { background: var(--surface); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* --- Pagination --- */
.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; align-items: center; }
.pagination a, .pagination span { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--sea); text-decoration: none; font-size: 0.88rem; background: var(--btn-surface); }
.pagination a:hover { background: var(--sea-light); }
.pagination span { color: var(--text-muted); cursor: default; }
.pagination .current { background: var(--sea); color: #fff; border-color: var(--sea); }
.main nav[role="navigation"] { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; align-items: center; }
.main nav[role="navigation"] > div { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.main nav[role="navigation"] a,
.main nav[role="navigation"] span { display: inline-block; padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.88rem; text-decoration: none; color: var(--sea); background: var(--btn-surface); font-family: inherit; }
.main nav[role="navigation"] a:hover { background: var(--sea-light); }
.main nav[role="navigation"] span { color: var(--text-muted); cursor: default; }
.main nav[role="navigation"] .bg-gray-800,
.main nav[role="navigation"] .bg-indigo-600 { background: var(--sea) !important; color: #fff !important; border-color: var(--sea) !important; }

/* --- Combobox: općina --- */
.combobox-opcina-wrap { position: relative; }
.combobox-opcina-wrap .combobox-input { width: 100%; max-width: none; }
.combobox-opcina-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 100;
  max-height: 220px; overflow-y: auto; margin-top: 2px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); list-style: none; padding: 0.25rem 0;
}
.combobox-opcina-list li {
  padding: 0.45rem 0.75rem; font-size: 0.9rem; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit; color: var(--text);
}
.combobox-opcina-list li:hover,
.combobox-opcina-list li[aria-selected="true"] { background: var(--sea-light); color: var(--text); }
.combobox-opcina-list li.no-results { cursor: default; color: var(--text-muted); }
.combobox-opcina-list li.no-results:hover { background: transparent; }

/* --- Combobox: country --- */
.combobox-country-wrap { position: relative; }
.combobox-country-wrap .combobox-input { width: 100%; max-width: none; }
.combobox-country-list {
  position: absolute; z-index: 50; left: 0; right: 0; max-height: 220px; overflow-y: auto;
  background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 6px;
  margin-top: 2px; padding: 0; list-style: none; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.combobox-country-list li { padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.88rem; }
.combobox-country-list li:hover,
.combobox-country-list li[aria-selected="true"] { background: var(--sea-light); color: var(--text); }
.combobox-country-list li.no-results { cursor: default; color: var(--text-muted); }
.combobox-country-list li.no-results:hover { background: transparent; }

/* --- Field info popover --- */
.field-info-btn {
  background: none; border: none; cursor: pointer; color: var(--sea);
  font-size: 0.82rem; padding: 0 0.2rem; position: relative; vertical-align: middle;
  opacity: 0.7; transition: opacity 0.15s;
}
.field-info-btn:hover { opacity: 1; }
.field-info-popover {
  position: absolute; z-index: 200; left: 0; top: calc(100% + 4px);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10); padding: 0.5rem 0.75rem;
  font-size: 0.8rem; color: var(--text); white-space: nowrap;
  font-weight: 400; line-height: 1.7;
}
.field-info-popover::before {
  content: ''; position: absolute; top: -5px; left: 10px;
  width: 8px; height: 8px; background: var(--white); border-left: 1px solid var(--border);
  border-top: 1px solid var(--border); transform: rotate(45deg);
}
.field-info-popover strong { display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }

/* --- Smooth collapse --- */
.smooth-collapse {
  overflow: hidden;
  transition: max-height 0.7s ease, opacity 0.5s ease;
  opacity: 1;
}
.smooth-collapse.is-collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* --- Mobile header --- */
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 500;
  background: var(--sea-dark); color: #fff;
  padding: 0.6rem 1rem;
  align-items: center; gap: 0.75rem;
}
.mobile-header-title {
  font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 500;
}
.hamburger-btn {
  background: none; border: none; cursor: pointer; padding: 0.25rem;
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.hamburger-btn svg { width: 24px; height: 24px; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.45); opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.is-visible { display: block; opacity: 1; }

/* --- Theme switcher --- */
.theme-option:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
.theme-swatch:hover { border-color: var(--sea) !important; }
.theme-swatch-active { border-color: var(--sea) !important; box-shadow: 0 0 0 2px rgba(26,107,122,0.2); }

/* --- Invoice display --- */
.invoice-header { font-size: 0.88rem; }
.invoice-reservation-link { font-size: 0.85rem; }

/* --- Bottom tab bar (mobile) --- */
.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem 0;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-tab-bar a svg { width: 22px; height: 22px; }
.bottom-tab-bar a.tab-active { color: var(--sea); font-weight: 600; }
.bottom-tab-bar a:active { opacity: 0.7; }

/* ═══════════════════════════════════════════
   Responsive: Tablet (≤768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  #perf-bar { display: none !important; }
  .mobile-header { display: flex; }
  .hide-mobile { display: none !important; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .app { display: block; }
  .main { padding: 1.25rem 1rem; max-width: 100%; padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px) + 1rem); }
  .page-header { margin-bottom: 0.25rem !important; padding-bottom: 0.2rem !important; border-bottom: none !important; }
  .page-header h1 { font-size: 1.4rem; }
  .page-header p { margin-top: 0.15rem !important; }
  th, td { padding: 0.4rem 0.5rem !important; font-size: 0.7rem !important; }
  th { font-size: 0.58rem !important; letter-spacing: 0.03em !important; }
  .form-group { margin-bottom: 0.5rem !important; }
  .form-group label { font-size: 0.65rem; margin-bottom: 0.1rem !important; }
  input, select, textarea { font-size: 0.72rem !important; padding: 0.25rem 0.4rem !important; }
  .divider { margin: 0.2rem 0 !important; border-top: none !important; }
  .invoice-items + .add-row { margin-top: 0.2rem !important; margin-bottom: 0.2rem !important; }
  .invoice-items ~ div[style*="text-align: right"] { margin: 0 !important; padding: 0 !important; border-top: none !important; }
  .card-body { font-size: 0.78rem; padding: 0.75rem; }
  .card-body .text-muted { font-size: 0.72rem; }
  .form-row { gap: 0.4rem !important; }
  .form-actions { margin-top: 0.1rem !important; padding-top: 0 !important; border-top: none !important; flex-wrap: wrap; }
  .form-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
  .invoice-header { font-size: 0.75rem !important; margin-bottom: 1rem !important; }
  .invoice-header .text-muted { font-size: 0.68rem !important; }
  .invoice-header > div[style*="position: absolute"] { position: static !important; margin-top: 0.75rem; }
  .invoice-header span { word-break: break-word; }
  .invoice-reservation-link { font-size: 0.72rem !important; }
  .stats { grid-template-columns: 1fr 1fr; }
  input[type="text"], input[type="number"], input[type="date"],
  input[type="email"], input[type="password"], input[type="file"],
  input[type="url"], select { max-width: 100%; }
  .invoice-items .item-row {
    grid-template-columns: 1fr 36px 65px 55px 62px 16px;
    gap: 0.2rem; font-size: 0.7rem; align-items: center; justify-items: start;
  }
  .invoice-items .item-row select, .invoice-items .item-row input { padding: 0.15rem 0.25rem !important; }
  .invoice-items h3 { font-size: 0.9rem !important; margin-bottom: 0.15rem !important; }
  .invoice-items + .add-row { margin-top: 0.1rem !important; margin-bottom: 0 !important; font-size: 0.7rem !important; }
  .invoice-items .item-row-wrap {
    padding-bottom: 0.1rem; margin-bottom: 0.1rem;
    border-bottom: none;
  }
  .invoice-items .item-row select { font-size: 0.72rem !important; padding: 0.25rem 0.3rem !important; }
  .invoice-items .item-row input { font-size: 0.72rem !important; padding: 0.25rem 0.3rem !important; }
  .invoice-items .item-subtotal { font-size: 0.68rem !important; min-width: auto !important; display: flex; align-items: center; }
  .invoice-items .remove-item { font-size: 0 !important; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0 !important; margin: 0; border: none; background: var(--terracotta); border-radius: 3px; cursor: pointer; transition: background 0.15s, color 0.15s; }
  .invoice-items .remove-item::after { content: '\00d7'; font-size: 0.75rem; color: #fff; font-weight: 700; line-height: 1; transition: color 0.15s; }
  .invoice-items .remove-item:hover { background: #fff; border: 1px solid var(--terracotta); }
  .invoice-items .remove-item:hover::after { color: var(--terracotta); }
  .invoice-items label { font-size: 0.62rem !important; gap: 0.15rem !important; white-space: nowrap; justify-self: center; }
  .invoice-items .remove-item { justify-self: center !important; }
  .invoice-items .commission-hint { font-size: 0.58rem !important; margin: -5px 0 0 !important; padding: 0 !important; line-height: 1.2; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .topbar { gap: 0.5rem; }
  .topbar .btn { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
  .bottom-tab-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .card-body > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .card-body dl[style*="grid-template-columns: auto 1fr auto 1fr"] {
    grid-template-columns: auto 1fr !important;
  }
}

/* ═══════════════════════════════════════════
   Mobile Focus Mode
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .form-group .hint { display: none; }
  .form-group.field-focused .hint { display: block; margin-top: 0.35rem; font-size: 0.78rem; }

  body.mobile-focus-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  body.mobile-focus-active .form-group.field-focused {
    position: relative;
    z-index: 51;
    background: var(--white, #fff);
    border-radius: 10px;
    padding: 0.75rem;
    margin: -0.5rem -0.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: box-shadow 0.25s ease;
  }
  body.mobile-focus-active .form-group.field-focused input,
  body.mobile-focus-active .form-group.field-focused select,
  body.mobile-focus-active .form-group.field-focused textarea {
    font-size: 1.1rem !important;
    padding: 0.65rem 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 700px) {
  .charts-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   Responsive: Mobile (≤480px)
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .main { padding: 1rem 0.75rem; padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px) + 1rem); }
}

/* ═══════════════════════════════════════════
   Print
   ═══════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .page-header, .no-print, #perf-bar, .alert, .mobile-header { display: none !important; }
  .print-only { display: block !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; max-width: 100% !important; overflow: visible !important; }
  body { font-size: 11pt; }
  .card { border: none !important; box-shadow: none !important; }
}
