:root {
  --polyeco-green: #73C92D;
  --polyeco-blue-gray: #7993A5;
  --polyeco-green-dark: #1e403d; /* Keeping a dark variant for UI contrast */
  --polyeco-green-light: #f0f7ed;
  --polyeco-accent: #73C92D;
}

/* ── Navbar ── */
.polyeco-nav {
  background: var(--polyeco-green-dark) !important;
  border-bottom: 4px solid var(--polyeco-green);
  padding: 0.75rem 1.5rem;
}

.polyeco-logo-box {
  background: white;
  border-radius: 6px;
  padding: 3px 10px;
}

.polyeco-logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  color: #78be20;
  letter-spacing: -0.5px;
}

.polyeco-logo-login {
  font-size: 2rem;
  font-weight: 800;
  color: var(--polyeco-green);
  letter-spacing: -1px;
}

/* ── Buttons ── */
.btn-polyeco {
  background: var(--polyeco-green);
  color: white;
  border: none;
}
.btn-polyeco:hover {
  background: var(--polyeco-green-dark);
  color: white;
}
.btn-outline-polyeco {
  border: 1px solid var(--polyeco-green);
  color: var(--polyeco-green);
  background: transparent;
}
.btn-outline-polyeco:hover {
  background: var(--polyeco-green);
  color: white;
}
.btn-xs {
  padding: 1px 5px;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 3px;
}

/* ── Text ── */
.text-polyeco { color: var(--polyeco-green) !important; }

/* ── Login ── */
.login-body {
  background: linear-gradient(135deg, var(--polyeco-green-light) 0%, #f5f5f5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }

.login-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: none;
}

.login-header {
  background: var(--polyeco-green-dark);
  padding: 2.5rem;
  text-align: center;
  border-bottom: 5px solid var(--polyeco-green);
}

.login-body-inner { padding: 2rem; }
.login-footer { padding: 1rem; border-top: 1px solid #eee; }

/* ── Expense table ── */
.expense-table input.form-control {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 2px 6px;
  font-size: 0.82rem;
  min-width: 80px;
}
.expense-table input.form-control:focus {
  background: #fffbea;
  box-shadow: inset 0 0 0 2px var(--polyeco-accent);
  z-index: 1;
  position: relative;
}
.expense-table td, .expense-table th {
  vertical-align: middle;
  padding: 4px 6px;
}

.section-header td {
  background: var(--polyeco-green-light);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-top: 2px solid var(--polyeco-green) !important;
}

/* ── Badges ── */
.badge-secondary { background-color: #6c757d; color: white; }
.badge-warning   { background-color: #ffc107; color: #333; }
.badge-info      { background-color: #0dcaf0; color: #333; }
.badge-success   { background-color: #198754; color: white; }
.badge-danger    { background-color: #dc3545; color: white; }
.badge-primary   { background-color: #0d6efd; color: white; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; display: inline-block; }

/* ── Approval stepper ── */
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
}
.step-circle.done   { background: var(--polyeco-green); color: white; }
.step-circle.active { background: var(--polyeco-accent); color: white; box-shadow: 0 0 0 3px #ffeab0; }
.step-circle.todo   { background: #e9ecef; color: #aaa; }

.step-line {
  flex: 1; height: 2px; background: #dee2e6; min-width: 20px; max-width: 40px;
}
.step-line.done { background: var(--polyeco-green); }

/* ── General ── */
body { background: #f8f9fa; font-family: 'Segoe UI', sans-serif; }
.card { border: none; border-radius: 10px; }
.card-header { background: #f8f9fa; border-bottom: 1px solid #eee; border-radius: 10px 10px 0 0 !important; }
.table th { font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.navbar-nav .nav-link { color: rgba(255,255,255,0.85) !important; font-size: 0.95rem; font-weight: 500; }
.navbar-nav .nav-link:hover { color: white !important; }

/* ════════════════════════════════════════════
   MOBILE / RESPONSIVE
   ════════════════════════════════════════════ */

/* Prevent iOS from zooming on input focus — keep font-size ≥ 16px */
@media (max-width: 767.98px) {

  /* Page padding */
  .container-fluid { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }

  /* Navbar */
  .polyeco-nav { padding: 0.4rem 0.75rem; }
  .polyeco-nav .navbar-brand img { height: 36px !important; }
  .navbar-nav .nav-link { font-size: 0.9rem; padding: 0.4rem 0.5rem !important; }

  /* Touch-friendly inputs — 16px prevents iOS auto-zoom */
  .form-control, .form-select, input, select, textarea {
    font-size: 16px !important;
    min-height: 42px;
  }
  .form-control-sm, .form-select-sm { min-height: 38px; }

  /* Expense table inputs are allowed smaller */
  .expense-table input.form-control { font-size: 14px !important; min-height: unset; min-width: 70px; }
  .expense-table .form-select       { font-size: 14px !important; min-height: unset; }

  /* Buttons */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .btn-xs { min-height: unset; }

  /* ── Dashboard ── */
  /* Scrollable tabs */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-item { flex-shrink: 0; }

  /* Hide secondary columns in dashboard/approval tables on mobile */
  .col-hide-mobile { display: none !important; }

  /* Dashboard header row */
  .dashboard-header { flex-direction: column; align-items: flex-start !important; gap: 0.5rem; }
  .dashboard-header .btn { width: 100%; }

  /* ── Expense form ── */
  /* Sticky action bar at the bottom */
  .form-sticky-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 2px solid var(--polyeco-green);
    padding: 0.6rem 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1040;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.12);
  }
  .form-sticky-bar .btn { flex: 1; min-height: 44px; font-size: 0.95rem; }
  /* Push page content above the sticky bar */
  .sticky-page-pad { padding-bottom: 80px; }

  /* Expense table: horizontal scroll, pinned category column */
  .expense-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .expense-table { min-width: 560px; }
  .expense-table td:first-child,
  .expense-table th:first-child { min-width: 140px; }

  /* Reduce card padding */
  .card-body { padding: 0.75rem !important; }
  .card-body.p-0 { padding: 0 !important; }

  /* Section header font */
  .section-header td { font-size: 0.78rem; padding: 5px 8px; }

  /* Approval modals / confirm buttons */
  .modal-dialog { margin: 0.5rem; }

  /* Scan modal — full screen */
  #scanModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100%;
    height: 100%;
  }
  #scanModal .modal-content {
    border-radius: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }
  #scanModal .modal-body { flex: 1; overflow-y: auto; }

  /* Summary cards on reports */
  .kpi-card { margin-bottom: 0.75rem; }
}

/* ── Scan review cards ── */
.review-cat.is-invalid {
  border-color: #dc3545;
  background-color: #fff8f8;
  animation: shake .25s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* Small phones */
@media (max-width: 400px) {
  .expense-table { min-width: 500px; }
  h4 { font-size: 1.05rem; }
}

/* ── Print Styles ── */
@media print {
  .navbar, .btn, .no-print, .polyeco-nav, #dashboardTabs, .dashboard-tabs, .pagination, .alert, .collapse {
    display: none !important;
  }
  body { background: white !important; padding: 0; margin: 0; color: black; }
  .container-fluid { padding: 0 !important; margin: 0 !important; }
  .card { border: 1px solid #ddd !important; box-shadow: none !important; margin-bottom: 20px !important; }
  .expense-table { width: 100% !important; border-collapse: collapse !important; }
  .expense-table th, .expense-table td { border: 1px solid #ddd !important; }
  .section-header td { background-color: #f0fdf0 !important; -webkit-print-color-adjust: exact; }
  .table-light { background-color: #f8f9fa !important; -webkit-print-color-adjust: exact; }
  .table-dark { background-color: #212529 !important; color: white !important; -webkit-print-color-adjust: exact; }
  .badge { border: 1px solid #ccc !important; color: black !important; background: transparent !important; }
  .step-circle { border: 1px solid #333 !important; color: #333 !important; }
  .step-line { border-bottom: 1px solid #333 !important; }
  h4 { font-size: 16pt !important; margin-top: 0 !important; }
}
