/*
  DOKUZOĞLU — Command Center Design System V3
  Obsidian + Amber Gold
*/

/* ── Import Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════════════ */
:root {
  /* ── Dokuzoğlu Premium Palette ── */
  --bg-primary: #161618;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --accent: #C8A45A;
  --accent-hover: #D4B87A;
  --success: #5B9A6F;
  --warning: #D4955C;
  --danger: #C75C5C;
  --text-primary: #E8E4DC;
  --text-secondary: #8A8A8A;
  --border: rgba(200, 164, 90, 0.12);
  --shadow: 0 4px 24px rgba(200, 164, 90, 0.08);
  --radius: 12px;
  --radius-sm: 8px;

  /* ── Extended Tokens (compat) ── */
  --bg-base: #161618;
  --bg-row-odd: rgba(255, 255, 255, 0.03);
  --bg-row-even: rgba(255, 255, 255, 0.01);
  --bg-row-hover: rgba(255, 255, 255, 0.06);
  --bg-input: #161618;
  --accent-dim: rgba(200, 164, 90, 0.12);
  --accent-glow: rgba(200, 164, 90, 0.25);
  --success-dim: rgba(91, 154, 111, 0.15);
  --warning-dim: rgba(212, 149, 92, 0.15);
  --error: #C75C5C;
  --error-dim: rgba(199, 92, 92, 0.15);
  --text-faint: #4A5568;
  --text-title: #F0EDE6;
  --border-accent: rgba(200, 164, 90, 0.12);
  --border-subtle: rgba(200, 164, 90, 0.08);
  --border-input: rgba(200, 164, 90, 0.15);
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;
  --shadow-card: 0 4px 24px rgba(200, 164, 90, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(200, 164, 90, 0.15);
  --shadow-modal: 0 16px 48px rgba(200, 164, 90, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition-fast: all 0.15s ease;
  --transition-base: all 0.22s ease;
  --transition-slow: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
  margin: 0;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-title);
}

h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-title);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-title);
}

h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */
.hidden {
  display: none !important;
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-faint {
  color: var(--text-faint);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 {
  gap: var(--sp-xs);
}

.gap-2 {
  gap: var(--sp-sm);
}

.gap-3 {
  gap: var(--sp-md);
}

.gap-4 {
  gap: var(--sp-lg);
}

.w-full {
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   VIEW SYSTEM (app.js compat)
   ══════════════════════════════════════════════════════════════ */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   TOP NAVIGATION BAR
   ══════════════════════════════════════════════════════════════ */
.top-nav {
  background: rgba(20, 30, 48, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-accent);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 var(--sp-xl);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--bg-base);
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: #C8A45A;
  color: #161618;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
}

.nav-logo-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: white;
  margin-left: 10px;
}

.nav-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-title);
  letter-spacing: 1px;
}

.nav-subtitle {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.nav-badge {
  padding: 2px 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(201, 169, 110, 0.2);
}

.card-static {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-base);
}

/* Metric Cards — Premium spec: border-left 4px accent, big mono value */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s ease backwards;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.metric-card__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}

.metric-card__value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.metric-card__value--white {
  color: var(--text-title);
}

.metric-card__value--success {
  color: var(--success);
}

.metric-card__value--error {
  color: var(--error);
}

.metric-card__sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: var(--sp-xs);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
}

.btn-secondary:hover {
  background: var(--accent-dim);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #d46a6a;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}

.btn-xs {
  font-size: 11px;
  padding: 4px 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(200, 164, 90, 0.35);
  transition: var(--transition-base);
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(200, 164, 90, 0.5);
}

/* ══════════════════════════════════════════════════════════════
   INPUTS
   ══════════════════════════════════════════════════════════════ */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 13px;
  transition: var(--transition-fast);
  outline: none;
  width: 100%;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8599' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ══════════════════════════════════════════════════════════════
   TABLES — Premium spec
   ══════════════════════════════════════════════════════════════ */
table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th,
table thead th,
th {
  background: var(--bg-primary);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr,
table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:nth-child(odd) {
  background: var(--bg-row-odd);
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-row-even);
}

.data-table tbody tr:hover,
table tbody tr:hover,
tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody td,
table tbody td,
td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table .td-mono,
td.font-mono,
.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.data-table .td-value {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
}

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(91, 154, 111, 0.3);
}

.badge-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: rgba(212, 149, 92, 0.3);
}

.badge-error {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(199, 92, 92, 0.3);
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-accent);
}

.badge-neutral {
  background: rgba(122, 133, 153, 0.12);
  color: var(--text-secondary);
  border-color: rgba(122, 133, 153, 0.2);
}

/* Category badges (app.js compat) */
.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cat-badge--amber {
  background: rgba(201, 169, 110, 0.15);
  color: var(--accent);
  border-color: var(--border-accent);
}

.cat-badge--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}

.cat-badge--purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}

.cat-badge--emerald {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(91, 154, 111, 0.25);
}

.cat-badge--cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.25);
}

.cat-badge--gray {
  background: rgba(122, 133, 153, 0.12);
  color: var(--text-secondary);
  border-color: rgba(122, 133, 153, 0.2);
}

/* Hakedis status badges (app.js compat) */
.hakedis-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.hakedis-status-pending {
  background: var(--warning-dim);
  color: var(--warning);
}

.hakedis-status-approved {
  background: var(--success-dim);
  color: var(--success);
}

.hakedis-status-rejected {
  background: var(--error-dim);
  color: var(--error);
}

.hakedis-reject-reason {
  font-size: 12px;
  color: var(--error);
  font-style: italic;
  padding: 4px 8px;
  background: var(--error-dim);
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(201, 169, 110, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ══════════════════════════════════════════════════════════════
   TABS — Premium pill style
   ══════════════════════════════════════════════════════════════ */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 6px;
  transition: 0.2s;
  position: relative;
  font-family: var(--font-sans);
  border-bottom: none;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(201, 169, 110, 0.1);
}

.tab-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-bottom-color: transparent;
}

.tab-btn i {
  margin-right: 6px;
  font-size: 12px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Catalog sub-tabs (app.js compat) */
.active-tab {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE — Premium centered layout with gradient
   ══════════════════════════════════════════════════════════════ */
#page-login,
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #161618;
  padding: var(--sp-xl);
  flex-direction: column;
}

.login-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(200, 164, 90, 0.15);
  border-radius: 16px;
  padding: 48px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: #C8A45A;
  color: #161618;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 14px;
  margin: 0 auto 16px;
}

.login-brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  color: white;
  text-align: center;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
  color: var(--text-title);
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 10px;
  letter-spacing: 4px;
  color: #C8A45A;
  text-align: center;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  text-align: left;
}

.login-form .input-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.login-form .btn-primary,
.login-form .btn.btn-primary {
  background: #C8A45A;
  color: #161618;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  padding: 12px;
  width: 100%;
  transition: 0.2s;
}

.login-form .btn-primary:hover,
.login-form .btn.btn-primary:hover {
  background: var(--accent-hover);
}

.login-error {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  background: var(--error-dim);
  color: var(--error);
  font-size: 12px;
  border: 1px solid rgba(199, 92, 92, 0.3);
}

.login-footer {
  margin-top: var(--sp-2xl);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════
   PROJECT CARDS GRID — Premium 3-column with stagger
   ══════════════════════════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition-base);
  animation: fadeIn 0.3s ease backwards;
}

.project-card:nth-child(2) {
  animation-delay: 0.05s;
}

.project-card:nth-child(3) {
  animation-delay: 0.1s;
}

.project-card:nth-child(4) {
  animation-delay: 0.15s;
}

.project-card:nth-child(5) {
  animation-delay: 0.2s;
}

.project-card:nth-child(6) {
  animation-delay: 0.25s;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(200, 164, 90, 0.15);
  border-color: rgba(200, 164, 90, 0.25);
}

.project-card h3 {
  font-weight: 600;
  font-size: 18px;
}

.project-card p,
.project-card span {
  color: var(--text-secondary);
  font-size: 13px;
}

.project-card__cost {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin: var(--sp-md) 0;
}

/* ══════════════════════════════════════════════════════════════
   GRIDS
   ══════════════════════════════════════════════════════════════ */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(22, 22, 24, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  padding: var(--sp-xl);
  border-bottom: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: var(--sp-xl);
}

.modal-footer {
  padding: var(--sp-lg) var(--sp-xl);
  border-top: 1px solid var(--border-accent);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
}

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
  max-width: 380px;
}

.toast-item {
  pointer-events: all;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  box-shadow: var(--shadow);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  animation: slideInRight 0.3s ease;
}

.toast-item.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.toast-hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Toast type border colors (app.js uses class names) */
.toast-item.border-emerald-500 {
  border-left: 3px solid var(--success);
}

.toast-item.border-rose-500 {
  border-left: 3px solid var(--error);
}

.toast-item.border-amber-500 {
  border-left: 3px solid var(--accent);
}

.toast-item.border-yellow-500 {
  border-left: 3px solid var(--warning);
}

/* Toast text color overrides (app.js compat) */
.text-emerald-300 {
  color: var(--success);
}

.text-rose-300 {
  color: var(--error);
}

.text-amber-300,
.text-amber-400,
.text-amber-500 {
  color: var(--accent);
}

.text-yellow-300 {
  color: var(--warning);
}

/* ══════════════════════════════════════════════════════════════
   IFC DROP ZONE
   ══════════════════════════════════════════════════════════════ */
.ifc-drop-zone {
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--sp-3xl) var(--sp-xl);
  text-align: center;
  background: rgba(201, 169, 110, 0.03);
  transition: var(--transition-base);
  cursor: pointer;
}

.ifc-drop-zone:hover,
.ifc-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(201, 169, 110, 0.08);
}

.ifc-drop-zone i {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: var(--sp-md);
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, rgba(201, 169, 110, 0.06) 25%, rgba(201, 169, 110, 0.12) 50%, rgba(201, 169, 110, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 14px;
  width: 80%;
  border-radius: var(--radius-sm);
}

.skeleton--value {
  height: 18px;
  width: 60px;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   SECTION WRAPPER
   ══════════════════════════════════════════════════════════════ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sp-xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header h2 {
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   WARNING BANNER
   ══════════════════════════════════════════════════════════════ */
.warning-banner {
  background: var(--warning-dim);
  border: 1px solid rgba(212, 149, 92, 0.3);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-lg);
  color: var(--warning);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

/* ══════════════════════════════════════════════════════════════
   FINANCIAL SHIELD CARD
   ══════════════════════════════════════════════════════════════ */
.shield-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
  margin: var(--sp-lg) 0;
}

.shield-item__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}

.shield-item__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-title);
}

/* Glass panel (app.js compat) */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
}

/* ══════════════════════════════════════════════════════════════
   MICRO-ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.animate-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   APP.JS COMPATIBILITY CLASSES
   ══════════════════════════════════════════════════════════════ */
/* Tailwind-like classes used by app.js innerHTML */
.border {
  border-width: 1px;
  border-style: solid;
}

.rounded {
  border-radius: var(--radius-sm);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: 9999px;
}

.shadow-xl {
  box-shadow: var(--shadow-card);
}

.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}

.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}

.px-3 {
  padding-left: 12px;
  padding-right: 12px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}

.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.py-0\.5 {
  padding-top: 2px;
  padding-bottom: 2px;
}

.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}

.py-1\.5 {
  padding-top: 6px;
  padding-bottom: 6px;
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.py-6 {
  padding-top: 24px;
  padding-bottom: 24px;
}

.py-8 {
  padding-top: 32px;
  padding-bottom: 32px;
}

.py-12 {
  padding-top: 48px;
  padding-bottom: 48px;
}

.p-2 {
  padding: 8px;
}

.p-4 {
  padding: 16px;
}

.p-6 {
  padding: 24px;
}

.pb-2 {
  padding-bottom: 8px;
}

.pb-3 {
  padding-bottom: 12px;
}

.pt-0 {
  padding-top: 0;
}

.pr-3 {
  padding-right: 12px;
}

.pr-4 {
  padding-right: 16px;
}

.mt-0\.5 {
  margin-top: 2px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-3 {
  margin-top: 12px;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mr-1 {
  margin-right: 4px;
}

.mr-1\.5 {
  margin-right: 6px;
}

.mr-2 {
  margin-right: 8px;
}

.ml-1 {
  margin-left: 4px;
}

.ml-1\.5 {
  margin-left: 6px;
}

.ml-2 {
  margin-left: 8px;
}

.text-xs {
  font-size: 11px;
}

.text-sm {
  font-size: 13px;
}

.text-lg {
  font-size: 18px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.text-4xl {
  font-size: 36px;
}

.text-\[10px\] {
  font-size: 10px;
}

.text-\[11px\] {
  font-size: 11px;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-mono {
  font-family: var(--font-mono);
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

.leading-none {
  line-height: 1;
}

.underline {
  text-decoration: underline;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-flex {
  display: inline-flex;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.flex-grow {
  flex-grow: 1;
}

.space-x-2>*+* {
  margin-left: 8px;
}

.space-x-3>*+* {
  margin-left: 12px;
}

.space-y-5>*+* {
  margin-top: 20px;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.items-start {
  align-items: flex-start;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.min-h-screen {
  min-height: 100vh;
}

.min-h-\[70vh\] {
  min-height: 70vh;
}

.max-w-7xl {
  max-width: 1280px;
}

.max-w-\[200px\] {
  max-width: 200px;
}

.max-w-\[220px\] {
  max-width: 220px;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.w-full {
  width: 100%;
}

.w-2 {
  width: 8px;
}

.w-16 {
  width: 64px;
}

.w-28 {
  width: 112px;
}

.h-2 {
  height: 8px;
}

.h-16 {
  height: 64px;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

.z-50 {
  z-index: 50;
}

.z-\[1000\] {
  z-index: 1000;
}

.opacity-30 {
  opacity: 0.3;
}

.opacity-40 {
  opacity: 0.4;
}

.opacity-50 {
  opacity: 0.5;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.select-none {
  user-select: none;
}

.transition-all {
  transition: var(--transition-base);
}

.transition-colors {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.transition-transform {
  transition: transform 0.15s ease;
}

.divide-y>*+* {
  border-top: 1px solid var(--border-subtle);
}

.divide-y-gray-800\/50>*+* {
  border-top: 1px solid rgba(30, 41, 59, 0.5);
}

.border-t {
  border-top: 1px solid var(--border-accent);
}

.border-b {
  border-bottom: 1px solid var(--border-accent);
}

.border-t-0 {
  border-top: none;
}

/* Color utility classes (used by app.js class strings) */
.text-white {
  color: #fff;
}

.text-gray-100 {
  color: var(--text-title);
}

.text-gray-200 {
  color: var(--text-primary);
}

.text-gray-300 {
  color: #b0b8c8;
}

.text-gray-400 {
  color: var(--text-secondary);
}

.text-gray-500 {
  color: var(--text-faint);
}

.text-gray-600 {
  color: #3a4556;
}

.text-blue-300,
.text-blue-400 {
  color: #60a5fa;
}

.text-emerald-300,
.text-emerald-400,
.text-emerald-500 {
  color: var(--success);
}

.text-purple-300 {
  color: #a78bfa;
}

.bg-gray-700 {
  background: #2d3748;
}

.bg-gray-700\/50 {
  background: rgba(45, 55, 72, 0.5);
}

.bg-gray-800 {
  background: var(--bg-base);
}

.bg-gray-800\/20 {
  background: rgba(12, 18, 34, 0.2);
}

.bg-gray-800\/30 {
  background: rgba(12, 18, 34, 0.3);
}

.bg-gray-800\/40 {
  background: rgba(12, 18, 34, 0.4);
}

.bg-gray-800\/60 {
  background: rgba(12, 18, 34, 0.6);
}

.bg-gray-800\/80 {
  background: rgba(12, 18, 34, 0.8);
}

.bg-emerald-500\/10 {
  background: rgba(91, 154, 111, 0.1);
}

.bg-emerald-500\/20 {
  background: rgba(91, 154, 111, 0.2);
}

.bg-emerald-600\/20 {
  background: rgba(91, 154, 111, 0.2);
}

.bg-emerald-600\/40 {
  background: rgba(91, 154, 111, 0.4);
}

.bg-rose-500\/10 {
  background: rgba(199, 92, 92, 0.1);
}

.bg-rose-600\/20 {
  background: rgba(199, 92, 92, 0.2);
}

.bg-blue-500\/5 {
  background: rgba(59, 130, 246, 0.05);
}

.bg-blue-500\/10 {
  background: rgba(59, 130, 246, 0.1);
}

.bg-amber-500\/10 {
  background: rgba(201, 169, 110, 0.1);
}

.bg-amber-500\/20 {
  background: rgba(201, 169, 110, 0.2);
}

.bg-purple-500\/20 {
  background: rgba(139, 92, 246, 0.2);
}

.bg-emerald-500 {
  background: var(--success);
}

.bg-black\/70 {
  background: rgba(0, 0, 0, 0.7);
}

.border-gray-600 {
  border-color: #4a5568;
}

.border-gray-700 {
  border-color: #2d3748;
}

.border-gray-700\/50 {
  border-color: rgba(45, 55, 72, 0.5);
}

.border-gray-800 {
  border-color: var(--bg-base);
}

.border-gray-800\/60 {
  border-color: rgba(12, 18, 34, 0.6);
}

.border-emerald-500 {
  border-color: var(--success);
}

.border-emerald-500\/30 {
  border-color: rgba(91, 154, 111, 0.3);
}

.border-emerald-600\/40 {
  border-color: rgba(91, 154, 111, 0.4);
}

.border-rose-500 {
  border-color: var(--error);
}

.border-rose-500\/20 {
  border-color: rgba(199, 92, 92, 0.2);
}

.border-rose-600\/40 {
  border-color: rgba(199, 92, 92, 0.4);
}

.border-amber-500 {
  border-color: var(--accent);
}

.border-amber-500\/30 {
  border-color: rgba(201, 169, 110, 0.3);
}

.border-amber-500\/40 {
  border-color: rgba(201, 169, 110, 0.4);
}

.border-blue-500\/20 {
  border-color: rgba(59, 130, 246, 0.2);
}

.border-yellow-500 {
  border-color: var(--warning);
}

.bg-yellow-500\/10 {
  background: rgba(212, 149, 92, 0.1);
}

.bg-gray-500\/20 {
  background: rgba(122, 133, 153, 0.2);
}

.border-gray-500\/30 {
  border-color: rgba(122, 133, 153, 0.3);
}

/* Hover overrides used by app.js */
.hover\:bg-white\/5:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hover\:bg-gray-800\/20:hover {
  background: rgba(12, 18, 34, 0.2);
}

.hover\:bg-gray-800\/30:hover {
  background: rgba(12, 18, 34, 0.3);
}

.hover\:text-white:hover {
  color: #fff;
}

.hover\:text-blue-300:hover {
  color: #60a5fa;
}

.hover\:text-rose-300:hover {
  color: #f87171;
}

.hover\:bg-emerald-500:hover {
  background: var(--success);
}

.hover\:bg-emerald-500\/20:hover {
  background: rgba(91, 154, 111, 0.2);
}

.hover\:bg-emerald-600\/40:hover {
  background: rgba(91, 154, 111, 0.4);
}

.hover\:bg-rose-500:hover {
  background: var(--error);
}

.hover\:bg-rose-500\/10:hover {
  background: rgba(199, 92, 92, 0.1);
}

.hover\:bg-blue-500\/10:hover {
  background: rgba(59, 130, 246, 0.1);
}

.focus\:border-emerald-500:focus {
  border-color: var(--success);
}

.focus\:border-amber-500:focus {
  border-color: var(--accent);
}

.focus\:outline-none:focus {
  outline: none;
}

.focus\:ring-1:focus {
  box-shadow: 0 0 0 1px;
}

.focus\:ring-amber-500\/30:focus {
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.3);
}

/* Responsive hidden utilities */
/* Responsive hidden utilities (no-op for desktop) */
.sm\:px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.lg\:px-8 {
  padding-left: 32px;
  padding-right: 32px;
}

.sm\:inline {
  display: inline;
}

.md\:inline {
  display: inline;
}

/* ══════════════════════════════════════════════════════════════
   CATALOG PRICE INPUT (app.js compat)
   ══════════════════════════════════════════════════════════════ */
.catalog-price-input {
  width: 112px;
  text-align: right;
  background: rgba(12, 18, 34, 0.6);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--success);
  transition: var(--transition-fast);
}

.catalog-price-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ══════════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════════ */
@media print {
  body {
    background: white;
    color: black;
  }

  .top-nav,
  #toast-container,
  .fab,
  .btn,
  .modal-overlay {
    display: none !important;
  }

  .card,
  .metric-card,
  .section-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

body.printing-executive-report .top-nav,
body.printing-executive-report #toast-container,
body.printing-executive-report .tab-nav {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Premium breakpoints
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .shield-grid {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .top-nav {
    padding: 0 var(--sp-md);
    height: 48px;
  }

  .nav-title {
    font-size: 14px;
  }

  .metric-card__value {
    font-size: 20px;
  }

  .login-card {
    padding: var(--sp-2xl) var(--sp-xl);
  }

  .data-table,
  table {
    font-size: 12px;
  }

  .data-table thead th,
  .data-table tbody td,
  th,
  td {
    padding: 8px 10px;
  }

  .fab {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .section-card {
    padding: var(--sp-lg);
  }

  .modal-box {
    max-width: 100%;
    margin: var(--sp-md);
  }
}

@media (max-width: 640px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .nav-actions {
    gap: var(--sp-sm);
  }
}

/* ══════════════════════════════════════════════════════════════
   PROJECT CARDS — Cost & Status (FAZ 2)
   ══════════════════════════════════════════════════════════════ */
.project-card .project-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
}

.project-card .project-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-card .project-status.active {
  background: rgba(91, 154, 111, 0.15);
  color: var(--success);
}

/* ══════════════════════════════════════════════════════════════
   MODAL OVERLAY (FAZ 2)
   ══════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-modal);
}

/* ══════════════════════════════════════════════════════════════
   FOREX CARD (FAZ 2)
   ══════════════════════════════════════════════════════════════ */
#forex-card {
  border-left-color: var(--success);
}

#forex-rate-value {
  font-size: 24px;
  color: var(--success);
}

/* ══════════════════════════════════════════════════════════════
   CHART CONTAINER (FAZ 2)
   ══════════════════════════════════════════════════════════════ */
#cost-distribution-chart {
  max-height: 280px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — 768px (FAZ 2)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr !important;
  }

  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   INVOICE STATUS BADGES (Gelir Tab)
   ══════════════════════════════════════════════════════════════ */
.invoice-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-draft {
  background: rgba(255, 255, 255, 0.1);
  color: #8A8A8A;
}

.status-sent {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.status-paid {
  background: rgba(34, 197, 94, 0.15);
  color: #4ADE80;
}

.status-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}

/* ══════════════════════════════════════════════════════════════
   TIMELINE (Vertical — Timeline Tab)
   ══════════════════════════════════════════════════════════════ */
.timeline-container {
  position: relative;
  padding-left: 40px;
}

.timeline-line {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(200, 164, 90, 0.2);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
  display: flex;
  gap: 24px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #C8A45A;
  position: absolute;
  left: -32px;
  top: 6px;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(200, 164, 90, 0.15);
}

.timeline-date {
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}

.timeline-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 164, 90, 0.12);
  border-radius: 12px;
  padding: 20px;
  flex: 1;
  transition: var(--transition-base);
  box-shadow: 0 4px 24px rgba(200, 164, 90, 0.08);
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 164, 90, 0.15);
  border-color: rgba(200, 164, 90, 0.25);
}

/* Milestone status border-left */
.milestone-planned {
  border-left: 3px solid #8A8A8A;
}

.milestone-in_progress {
  border-left: 3px solid #C8A45A;
}

.milestone-completed {
  border-left: 3px solid #4ADE80;
}

.milestone-delayed {
  border-left: 3px solid #F87171;
}

/* Timeline responsive */
@media (max-width: 640px) {
  .timeline-container {
    padding-left: 28px;
  }

  .timeline-dot {
    left: -22px;
    width: 10px;
    height: 10px;
  }

  .timeline-item {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-date {
    min-width: auto;
  }
}

/* ══════════════════════════════════════════════════════════════
   SAHA FOTOĞRAF — Photo Grid & Cards
   ══════════════════════════════════════════════════════════════ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

.photo-card {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 164, 90, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(200, 164, 90, 0.15);
}

.photo-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.photo-card-info {
  padding: 12px;
}

.photo-card-info .photo-caption {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.photo-card-info .photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
}

.photo-card-info .photo-meta .photo-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.photo-card-info .photo-meta .photo-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
}

/* Hover overlay with edit/delete icons */
.photo-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-card:hover .photo-card-overlay {
  opacity: 1;
}

.photo-card-overlay button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.photo-card-overlay button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.photo-card-overlay button.delete-btn:hover {
  background: var(--error);
  border-color: var(--error);
}

/* ── Photo Category Badges ── */
.photo-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.photo-category-badge.cat-general {
  background: rgba(255, 255, 255, 0.1);
  color: #E8E4DC;
}

.photo-category-badge.cat-progress {
  background: rgba(200, 164, 90, 0.15);
  color: #C8A45A;
}

.photo-category-badge.cat-problem {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}

.photo-category-badge.cat-inspection {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.photo-category-badge.cat-delivery {
  background: rgba(34, 197, 94, 0.15);
  color: #4ADE80;
}

.photo-category-badge.cat-before {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
}

.photo-category-badge.cat-after {
  background: rgba(14, 165, 233, 0.15);
  color: #38BDF8;
}

/* ── Photo Lightbox ── */
.photo-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.photo-lightbox-info {
  margin-top: 16px;
  text-align: center;
  color: var(--text-primary);
  max-width: 600px;
}

.photo-lightbox-info .lightbox-caption {
  font-size: 14px;
  margin-bottom: 6px;
}

.photo-lightbox-info .lightbox-meta {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.photo-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 10000;
}

.photo-lightbox-close:hover {
  background: var(--error);
  border-color: var(--error);
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 10000;
}

.photo-lightbox-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.photo-lightbox-nav.prev {
  left: 24px;
}

.photo-lightbox-nav.next {
  right: 24px;
}

/* ── Photo Dropzone ── */
.photo-dropzone {
  border: 2px dashed rgba(200, 164, 90, 0.3);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: border-color 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

.photo-dropzone:hover {
  border-color: rgba(200, 164, 90, 0.5);
}

.photo-dropzone.dragover {
  border-color: #C8A45A;
  background: rgba(200, 164, 90, 0.05);
}

.photo-dropzone i {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

/* ── Photo Upload Progress ── */
.photo-upload-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.photo-upload-progress .bar {
  height: 100%;
  background: #C8A45A;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ── Photo Tab Header Bar ── */
.photo-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.photo-header-bar .photo-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Photo empty state */
.photo-empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-faint);
}

.photo-empty-state i {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.3;
}

@media (max-width: 768px) {
  .photo-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-header-bar .photo-filters {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════
   AI CHATBOT STYLES
   ══════════════════════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(200, 164, 90, 0.12);
  border-radius: 16px;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(200, 164, 90, 0.12);
  background: rgba(200, 164, 90, 0.04);
}

.chat-header h2 {
  margin: 0;
  font-size: 16px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-welcome {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.chat-welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.chat-welcome h3 {
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 18px;
}

.chat-welcome p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 24px;
}

.chat-bubble {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: chatFadeIn 0.3s ease-out;
}

.chat-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bot {
  align-self: flex-start;
}

@keyframes chatFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(200, 164, 90, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-text {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-user .chat-text {
  background: rgba(200, 164, 90, 0.15);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-bot .chat-text {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 164, 90, 0.08);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-text strong {
  color: var(--accent);
}

.chat-bullet {
  color: var(--accent);
  font-weight: 700;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid rgba(200, 164, 90, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.chat-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 164, 90, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input-bar input:focus {
  border-color: var(--accent);
}

.chat-send-btn {
  border-radius: 12px !important;
  padding: 12px 16px !important;
}

.chat-suggestions,
.chat-suggestions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chat-suggestions-inline {
  justify-content: flex-start;
  margin-top: 4px;
}

.chat-suggestion-chip {
  background: rgba(200, 164, 90, 0.08);
  border: 1px solid rgba(200, 164, 90, 0.2);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.chat-suggestion-chip:hover {
  background: rgba(200, 164, 90, 0.2);
  transform: translateY(-1px);
}

/* Typing animation */
.chat-typing .chat-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .chat-container {
    height: calc(100vh - 160px);
  }

  .chat-bubble {
    max-width: 90%;
  }
}

/* ══════════════════════════════════════════════════════════════
   AI COST ESTIMATION PANEL
   ══════════════════════════════════════════════════════════════ */
.estimate-panel {
  border: 1px solid rgba(200, 164, 90, 0.12);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.estimate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  background: rgba(200, 164, 90, 0.04);
  transition: background 0.2s;
}

.estimate-header:hover {
  background: rgba(200, 164, 90, 0.08);
}

.estimate-header h3 {
  margin: 0;
  font-size: 15px;
}

.estimate-header i:last-child {
  color: var(--text-faint);
  transition: transform 0.3s;
}

.estimate-form {
  padding: 20px;
  animation: chatFadeIn 0.3s ease-out;
}

.estimate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.estimate-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.estimate-field input[type="number"],
.estimate-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 164, 90, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
}

.estimate-result {
  margin-top: 20px;
  animation: chatFadeIn 0.3s ease-out;
}

.estimate-summary {
  background: rgba(200, 164, 90, 0.06);
  border: 1px solid rgba(200, 164, 90, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.estimate-total {
  text-align: center;
  margin-bottom: 16px;
}

.estimate-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.estimate-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.estimate-gbp {
  display: block;
  font-size: 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.estimate-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.estimate-metric span {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
}

.estimate-metric strong {
  font-size: 14px;
  color: var(--text-primary);
}

.estimate-breakdown {
  margin-bottom: 16px;
}

.estimate-breakdown h4 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.estimate-row {
  display: grid;
  grid-template-columns: 200px 1fr 120px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.estimate-row-label {
  font-size: 13px;
}

.estimate-row-bar {
  height: 8px;
  background: rgba(200, 164, 90, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.estimate-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #e8b94a);
  border-radius: 4px;
  transition: width 0.6s ease-out;
}

.estimate-row-values {
  text-align: right;
  font-size: 13px;
  font-family: var(--font-mono);
}

.estimate-row-values small {
  color: var(--text-faint);
  margin-left: 8px;
}

.estimate-notes {
  border-top: 1px solid rgba(200, 164, 90, 0.08);
  padding-top: 12px;
}

.estimate-note {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
}

@media (max-width: 768px) {
  .estimate-grid {
    grid-template-columns: 1fr 1fr;
  }

  .estimate-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .estimate-metrics {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Core Layout
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {

  /* Navigation */
  .nav-bar {
    padding: 0 var(--sp-sm);
    height: 48px;
  }

  .nav-logo {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .nav-title {
    font-size: 14px;
  }

  .nav-subtitle {
    display: none;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-actions .btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Main Content Area */
  .view-container,
  .main-content,
  .dashboard-content,
  [class*="content-area"],
  [id^="page-"] {
    padding: 12px !important;
  }

  /* Metric Cards Grid */
  .metric-grid,
  .metrics-grid,
  .stats-grid,
  [class*="metric"]+[class*="metric"],
  .flex.gap-4 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-card .metric-value,
  .metric-card .value {
    font-size: 18px;
  }

  .metric-card .metric-label,
  .metric-card .label {
    font-size: 10px;
  }

  /* Tab Buttons */
  .tab-bar,
  .tabs,
  [class*="tab-container"],
  [class*="tab-buttons"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }

  .tab-bar::-webkit-scrollbar,
  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn,
  [class*="tab-btn"] {
    white-space: nowrap;
    font-size: 11px;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  /* Tables — horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 12px;
  }

  table th,
  table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Modals */
  .modal-overlay .modal,
  .modal-content,
  [class*="modal-body"] {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 5vh auto;
    border-radius: 12px;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  /* Buttons — touch-friendly */
  .btn {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .btn-sm {
    min-height: 36px;
    padding: 8px 12px;
  }

  .btn-xs {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Forms */
  .input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
    /* prevents iOS zoom on focus */
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Card layouts */
  .card,
  .panel {
    padding: 12px;
    border-radius: 10px;
  }

  /* Login page */
  .login-card {
    width: 95vw !important;
    max-width: 400px;
    padding: 24px 20px;
  }

  .login-card h1 {
    font-size: 20px;
  }

  /* IFC Preview */
  .ifc-preview-table {
    font-size: 11px;
  }

  /* Shield / Track A panel */
  .shield-grid,
  [class*="shield"] .flex {
    flex-direction: column;
    gap: 8px;
  }

  /* Share section */
  .share-panel {
    flex-direction: column;
  }

  /* Section headers */
  .section-title,
  .section-header h2 {
    font-size: 16px;
  }

  /* Cost distribution chart */
  .chart-container canvas {
    max-height: 200px;
  }

  /* Flex utilities override */
  .flex-col-mobile {
    flex-direction: column !important;
  }
}

/* ── Phone (≤ 480px) ── */
@media (max-width: 480px) {

  .metric-grid,
  .metrics-grid,
  .stats-grid,
  .flex.gap-4 {
    grid-template-columns: 1fr !important;
  }

  .metric-card .metric-value,
  .metric-card .value {
    font-size: 16px;
  }

  .nav-bar {
    height: 44px;
    padding: 0 8px;
  }

  .nav-title {
    font-size: 13px;
  }

  .nav-logo {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .tab-btn,
  [class*="tab-btn"] {
    font-size: 10px;
    padding: 5px 8px;
  }

  /* Full-width modals */
  .modal-overlay .modal,
  .modal-content,
  [class*="modal-body"] {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0;
    border-radius: 0;
  }

  /* Login */
  .login-card {
    width: 100vw !important;
    max-width: 100vw;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Toast notifications */
  .toast {
    width: 90vw;
    left: 5vw;
    right: 5vw;
    font-size: 13px;
  }

  /* Hidden on mobile utility */
  .hide-mobile {
    display: none !important;
  }
}

/* ── Touch-friendly hover removal ── */
@media (hover: none) and (pointer: coarse) {
  .metric-card:hover {
    transform: none;
  }

  .photo-card:hover {
    transform: none;
  }

  .photo-card:hover .photo-card-overlay {
    opacity: 0;
  }

  .photo-card-overlay {
    opacity: 1;
    background: transparent;
  }

  .btn:hover {
    transform: none;
  }

  /* Make photo overlay buttons always visible on touch */
  .photo-card .photo-card-overlay {
    opacity: 1;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.6));
    justify-content: flex-end;
    padding-bottom: 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION — 17 Tab Support
   ══════════════════════════════════════════════════════════════ */

/* Tab navigation: horizontal scroll with fade edges */
@media (max-width: 1200px) {
  .tab-nav {
    position: relative;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 3px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .tab-btn i {
    margin-right: 4px;
  }
}

@media (max-width: 768px) {

  /* Tab pills: more compact */
  .tab-nav {
    gap: 1px;
    padding: 2px;
    margin-bottom: 16px;
  }

  .tab-btn {
    padding: 7px 10px;
    font-size: 11px;
    border-radius: 6px;
  }

  /* Dashboard charts: single column */
  #dashboard-charts-row {
    grid-template-columns: 1fr !important;
  }

  /* Metric cards: 2 columns on tablet */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .metric-card {
    padding: 12px !important;
  }

  .metric-card__value {
    font-size: 1.1rem !important;
  }

  /* Field management grid: single column */
  #tab-field>div:last-child {
    grid-template-columns: 1fr !important;
  }

  /* Scorecard: 2 columns */
  #tab-scorecard>div:first-of-type {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Reports grid */
  #tab-reports>div:last-child {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Table responsive */
  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px !important;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 1rem;
  }

  /* Buttons more tappable */
  .btn {
    min-height: 36px;
  }

  .btn-sm {
    min-height: 32px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {

  /* Tab icons only on mobile (hide text) */
  .tab-btn {
    padding: 8px 10px;
    font-size: 14px;
  }

  .tab-btn i {
    margin-right: 0;
  }

  /* Metric cards: single column on small phones */
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Scorecard: single column */
  #tab-scorecard>div:first-of-type {
    grid-template-columns: 1fr !important;
  }

  /* Reports: single column */
  #tab-reports>div:last-child {
    grid-template-columns: 1fr !important;
  }

  /* Page padding */
  #page-detail {
    padding: 8px !important;
  }

  /* Calendar events */
  #cal-events>div {
    font-size: 0.8rem !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════════════════════════════ */
body.theme-light {
  --bg-primary: #f5f3ef;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --accent: #9e7e2e;
  --accent-hover: #b8922e;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --bg-base: #f5f3ef;
  --bg-row-odd: rgba(0, 0, 0, 0.02);
  --bg-row-even: rgba(0, 0, 0, 0.01);
  --bg-row-hover: rgba(0, 0, 0, 0.05);
  --bg-input: #fff;
  --accent-dim: rgba(158, 126, 46, 0.1);
  --accent-glow: rgba(158, 126, 46, 0.2);
  --text-faint: #999;
  --text-title: #1a1a2e;
  --border-accent: rgba(158, 126, 46, 0.15);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-input: rgba(0, 0, 0, 0.12);
  --muted: #888;
  --surface: rgba(0, 0, 0, 0.03);
  background: #f5f3ef;
  color: #1a1a2e;
}

body.theme-light .card,
body.theme-light .metric-card,
body.theme-light .section-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .tab-nav {
  background: #e8e5e0;
}

body.theme-light .tab-btn.active {
  background: #fff;
  color: #9e7e2e;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  background: #fff;
  color: #1a1a2e;
  border-color: rgba(0, 0, 0, 0.15);
}

body.theme-light .data-table th {
  background: rgba(0, 0, 0, 0.04);
  color: #333;
}

body.theme-light .login-card {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
}