:root {
  --bg: #edf8f1;
  --bg-soft: #f7fff9;
  --panel: #ffffff;
  --panel-alt: #edf9f1;
  --primary: #1d9a5f;
  --primary-dark: #136a44;
  --primary-soft: rgba(29, 154, 95, 0.12);
  --text: #1c2333;
  --muted: #5f6f88;
  --border: #dfeee6;
  --success: #1d9a5f;
  --success-soft: rgba(29, 154, 95, 0.12);
  --warning: #ef9f2d;
  --warning-soft: rgba(239, 159, 45, 0.12);
  --danger: #d94e5d;
  --danger-soft: rgba(217, 78, 93, 0.12);
  --shadow: 0 16px 40px rgba(16, 79, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #edf8f1 0%, #f8fffb 100%);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(135deg, #0d5d38 0%, #157d4d 50%, #1d9a5f 100%);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 12px 30px rgba(12, 68, 42, 0.18);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 220px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 700;
  padding: 0.6rem 0.95rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.lang-label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lang-pill {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lang-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.lang-link:hover {
  color: white;
}

.lang-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(47, 87, 196, 0.08);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.9rem, 2vw, 2.5rem);
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card.primary {
  background: linear-gradient(135deg, #edfdf4 0%, #dff7eb 100%);
}

.stat-card.success {
  background: linear-gradient(135deg, #ebfff6 0%, #dff9ee 100%);
}

.stat-card.warning {
  background: linear-gradient(135deg, #fff7eb 0%, #fff0d6 100%);
}

.stat-card.accent {
  background: linear-gradient(135deg, #eefcf5 0%, #e6f8ee 100%);
}

.stat-card.accent-alt {
  background: linear-gradient(135deg, #fff6ee 0%, #ffead8 100%);
}

.stat-card.revenue {
  background: linear-gradient(135deg, #eefdf7 0%, #ddf9ed 100%);
}

.stat-card.warning-alt {
  background: linear-gradient(135deg, #fff3f1 0%, #ffe5e1 100%);
}

.stat-card.success-alt {
  background: linear-gradient(135deg, #edfff3 0%, #dff8e5 100%);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.stat-card .label {
  display: block;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card strong {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1.1;
  margin: 0.2rem 0 0.4rem;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chip.success {
  background: var(--success-soft);
  color: var(--success);
}

.chip.warning {
  background: var(--warning-soft);
  color: #b66e06;
}

.chip.info {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.chip.neutral {
  background: #edf8f1;
  color: #2f7a55;
}

.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-panel {
  min-height: 320px;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 0.9rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

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

.full-width {
  grid-column: 1 / -1;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, textarea, select, button {
  font: inherit;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 600;
}

input, textarea, select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(37, 87, 214, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 87, 214, 0.08);
}

button {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(29, 154, 95, 0.2);
}

button:hover {
  transform: translateY(-1px);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-alt);
  color: var(--text);
}

.status {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status.open {
  background: #e9f2ff;
  color: #2a5fc2;
}

.status.in-progress {
  background: #fff1dc;
  color: #b86d09;
}

.status.completed {
  background: #dff6ee;
  color: #147d59;
}

.flash-container {
  margin-bottom: 1rem;
}

.flash-message {
  background: #e7f7ed;
  border: 1px solid #bfe8cf;
  color: #1f6d48;
  border-radius: 10px;
  padding: 0.8rem 1rem;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-form select {
  min-width: 120px;
}

.inline-form button {
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
}

.report-actions {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.button-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.8rem 1rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(29, 154, 95, 0.2);
}

.button-link:hover {
  opacity: 0.96;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    padding: 0.9rem 1rem 1rem;
  }

  .brand-wrap {
    min-width: auto;
    flex: 1;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-shell {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    background: rgba(8, 67, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 0.75rem;
  }

  .nav-shell.open {
    display: flex;
  }

  .main-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .main-nav a {
    text-align: center;
    padding: 0.7rem 0.5rem;
    font-size: 0.78rem;
  }

  .lang-switcher {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .lang-pill {
    width: 100%;
    justify-content: center;
  }

  .container {
    margin-top: 1.25rem;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 0.8rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .brand-main {
    font-size: 0.9rem;
  }

  .brand-sub {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .lang-switcher {
    flex-direction: column;
    align-items: stretch;
  }

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

  .main-nav {
    grid-template-columns: 1fr;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

/* HOROMA REPORTS FULL RESPONSIVE DESIGN */


/* HOROMA REPORTS FULL RESPONSIVE DESIGN */

.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.report-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    flex: 1 1 650px;
    align-items: end;
    gap: 1rem;
    min-width: 0;
}

.report-form label {
    min-width: 0;
    width: 100%;
}

.report-form input,
.report-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.report-form button {
    width: 100%;
    min-height: 44px;
}

.report-actions > .button-link {
    flex: 0 1 auto;
    text-align: center;
    white-space: normal;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.stats-grid > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-actions ~ .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.report-actions ~ .panel table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

.report-actions ~ .panel th,
.report-actions ~ .panel td {
    padding: 0.75rem;
    overflow-wrap: anywhere;
}

.report-actions ~ .panel th {
    white-space: normal;
}

.report-actions ~ .panel td {
    max-width: 320px;
}

@media (min-width: 1200px) {
    .report-form {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }

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

@media (min-width: 721px) and (max-width: 1199px) {
    .report-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .report-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .report-form {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .report-form label {
        width: 100%;
    }

    .report-form button {
        grid-column: 1 / -1;
    }

    .report-actions > .button-link {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .report-actions ~ .panel {
        padding: 1rem;
    }

    .report-actions ~ .panel table {
        min-width: 650px;
    }
}

@media (max-width: 480px) {
    .report-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-form button {
        grid-column: auto;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-actions ~ .panel {
        padding: 0.75rem;
    }

    .report-actions ~ .panel th,
    .report-actions ~ .panel td {
        padding: 0.65rem 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .report-actions,
    .stats-grid,
    .report-form {
        min-width: 0;
    }

    .report-actions ~ .panel table {
        min-width: 600px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .report-actions {
        align-items: flex-end;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}
