@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css");

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* ── Login page ─────────────────────────────────────────── */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 100px auto;
  padding: 2em;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.5em;
  margin: 0.5em 0 1em 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  width: 100%;
  padding: 0.7em;
  background: #13753d;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1em;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 2em;
  border-radius: 8px;
  width: 300px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.close {
  color: #aaa;
  float: right;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
}

/* ── Intranet sidebar layout ────────────────────────────── */
.intranet-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 220px;
  min-width: 220px;
  background: #13753d;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo img {
  width: 120px;
  display: block;
  margin: 0 auto;
  filter: brightness(0) invert(1); /* white logo on green */
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-left-color: #fff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem 0;
}

.sidebar-link--logout {
  color: rgba(255, 180, 170, 0.9);
}

.sidebar-link--logout:hover {
  background: rgba(255, 80, 60, 0.18);
  color: #ffb4aa;
}

/* Main content area */
.intranet-content {
  flex: 1;
  padding: 2rem;
  background: #f4f4f4;
  overflow-y: auto;
}

/* ── Dashboard ──────────────────────────────────────────── */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.dash-subtitle {
  color: #666;
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
}

.dash-profile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  transition: background 0.15s;
}

.dash-profile-link:hover {
  background: #e4e4e4;
  text-decoration: none;
}

.dash-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #13753d;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.dash-profile-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a1a;
}

.dash-profile-email {
  font-size: 0.78rem;
  color: #888;
}

/* Summary cards grid */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.25rem 0.85rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: box-shadow 0.18s;
}

.dash-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.dash-card-body {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
}

.dash-card-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
}

.dash-card-label {
  font-size: 0.82rem;
  color: #777;
  margin-top: 0.5rem;
}

.dash-card-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #13753d;
  text-decoration: none;
  margin-top: 0;
  padding-top: 0.5rem;
  /* border-top: 1px solid #f0f0f0; */
}

.dash-card-link:hover {
  text-decoration: underline;
}

/* ── Invoice table ──────────────────────────────────────── */
.inv-table-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  overflow-x: auto;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.inv-table thead tr {
  background: #f7f7f7;
  border-bottom: 2px solid #e8e8e8;
}

.inv-table th {
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  white-space: nowrap;
}

.inv-table td {
  padding: 0.85rem 1.1rem;
  color: #2a2a2a;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.inv-table tbody tr:last-child td {
  border-bottom: none;
}

.inv-table tbody tr:hover td {
  background: #fafafa;
}

.inv-number {
  font-family: monospace;
  font-size: 0.88rem;
  color: #555;
}

.inv-date {
  white-space: nowrap;
  color: #666;
}

/* Platform badge */
.inv-platform-badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Status badges */
.inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25em 0.7em;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.inv-badge--paid {
  background: #e8f5ee;
  color: #13753d;
}

.inv-badge--pending {
  background: #fff5e5;
  color: #9e6a1a;
}

.inv-badge--inactive {
  background: #efefef;
  color: #888;
}

/* Calculator styles */

    [data-theme="dark"] {
      --bg: #3c404b;
      --surface: #141720;
      --surface2: #1c2030;
      --border: #252a3a;
      --text: #e8eaf0;
      --muted: #6b7280;
      --accent: #5fffb0;
      --accent2: #4a9eff;
      --yellow: #f5c842;
      --output-bg: #0a1628;
      --output-border: #1e3a5f;
      --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
      --h1-color: #ffffff;
      --noise-op: 0.03;
    }

    [data-theme="light"] {
      --bg: #f0f2f7;
      --surface: #ffffff;
      --surface2: #f5f6fa;
      --border: #dde1ec;
      --text: #1a1d2e;
      --muted: #8892a4;
      --accent: #00b870;
      --accent2: #2277e0;
      --yellow: #a06000;
      --output-bg: #eaf2ff;
      --output-border: #b8d4f8;
      --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
      --h1-color: #0d0f14;
      --noise-op: 0.015;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    .wrapper {
      max-width: 1024px;
      margin: 0 auto;
      position: relative;
      /* z-index: 1; */
    }

    /* ── HEADER ── */
    header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 2.5rem;
      gap: 1rem;
    }

    .tag {
      display: inline-block;
      background: var(--accent);
      color: var(--bg);
      font-size: 0.62rem;
      font-weight: 500;
      letter-spacing: 0.15em;
      padding: 0.25rem 0.75rem;
      text-transform: uppercase;
      margin-bottom: 0.75rem;
    }

    h1 {
      font-family: Arial, Helvetica, sans-serif;
      font-size: clamp(1.6rem, 3.5vw, 2.6rem);
      font-weight: 600;
      line-height: 1.2;
      letter-spacing: -0.01em;
      color: var(--h1-color);
      transition: color 0.3s;
    }

    h1 span {
      color: var(--accent);
    }

    .subtitle {
      color: var(--muted);
      font-size: 0.9rem;
      margin-top: 0.4rem;
    }

    /* ── THEME TOGGLE ── */
    .theme-switch {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      cursor: pointer;
      user-select: none;
      flex-shrink: 0;
      margin-top: 0.3rem;
    }

    .theme-icon {
      font-size: 0.9rem;
      line-height: 1;
    }

    .toggle-track {
      width: 42px;
      height: 24px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 12px;
      position: relative;
      transition: background 0.3s, border-color 0.3s;
    }

    .toggle-thumb {
      position: absolute;
      top: 4px;
      left: 4px;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--accent);
      transition: transform 0.25s cubic-bezier(.4, 0, .2, 1), background 0.3s;
    }

    [data-theme="light"] .toggle-thumb {
      transform: translateX(18px);
    }

    /* ── LAYOUT ── */
    .layout {
      display: grid;
      grid-template-columns: 1.15fr 0.85fr;
      gap: 1.25rem;
      align-items: start;
    }

    @media (max-width: 760px) {
      .layout {
        grid-template-columns: 1fr;
      }

      body {
        padding: 5px;
      }
    }

    /* ── PANELS ── */
    .panel {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 1.5rem;
      box-shadow: var(--shadow);
      transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    }

    .panel-title {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 1rem;
      font-weight: 600;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 1.25rem;
      padding-bottom: 0.65rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .panel-title::before {
      content: '';
      width: 7px;
      height: 7px;
      background: var(--accent);
      display: inline-block;
      flex-shrink: 0;
    }

    /* ── FORM ELEMENTS ── */
    .field {
      margin-bottom: 1rem;
    }

    label {
      display: block;
      font-size: 0.9rem;
      color: var(--muted);
      margin-bottom: 0.35rem;
      letter-spacing: 0.04em;
    }

    input[type="number"],
    select {
      width: 100%;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--yellow);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 1rem;
      padding: 0.55rem 0.75rem;
      outline: none;
      transition: border-color 0.2s, background 0.3s, color 0.3s;
    }

    input[type="number"]:focus,
    select:focus {
      border-color: var(--accent);
    }

    input[type="number"]::-webkit-inner-spin-button {
      opacity: 0.4;
    }

    select {
      appearance: none;
      cursor: pointer;
      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='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.6rem center;
      padding-right: 2rem;
    }

    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }

    .field-group-title {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 0.58rem;
      font-weight: 700;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--accent2);
      margin: 1.25rem 0 0.65rem;
      padding-top: 0.9rem;
      border-top: 1px dashed var(--border);
    }

    /* ── PLATFORM TABS ── */
    .platform-tabs {
      display: flex;
      gap: 0.4rem;
      margin-bottom: 1.25rem;
      flex-wrap: wrap;
    }

    .ptab {
      flex: 1;
      min-width: 90px;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--muted);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 0.8rem;
      padding: 0.6rem 0.4rem;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s;
      letter-spacing: 0.03em;
      white-space: nowrap;
    }

    .ptab:hover {
      border-color: var(--accent);
      color: var(--text);
    }

    .ptab.active {
      background: var(--accent);
      border-color: var(--accent);
      color: var(--bg);
      font-weight: 500;
    }

    /* Estrato hidden state */
    .estrato-row {
      transition: opacity 0.25s;
    }

    .estrato-row.hidden {
      opacity: 0.25;
      pointer-events: none;
    }

  /* ── CALC BUTTON ── */
    .calc-btn {
      width: 100%;
      background: var(--accent);
      color: var(--bg);
      border: none;
      font-family: Arial, Helvetica, sans-serif;
      font-weight: 600;
      font-size: 1rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.85rem;
      cursor: pointer;
      transition: opacity 0.2s, transform 0.1s;
      margin-top: 1.25rem;
    }

    .calc-btn:hover {
      opacity: 0.85;
    }

    .calc-btn:active {
      transform: scale(0.99);
    }

    /* ── OUTPUT PANEL ── */
    .output-panel {
      background: var(--output-bg);
      border: 1px solid var(--output-border);
      padding: 1.5rem;
      margin-top: 1.25rem;
      grid-column: 1 / -1;
      box-shadow: var(--shadow);
      transition: background 0.3s, border-color 0.3s;
    }

    .output-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.75rem;
      margin-bottom: 1.25rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--output-border);
    }

    .output-platform-name {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 1.3rem;
      font-weight: 600;
      color: var(--h1-color);
      transition: color 0.3s;
    }

    .output-badges {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
    }

    .badge {
      font-size: 0.58rem;
      padding: 0.2rem 0.5rem;
      border: 1px solid var(--border);
      color: var(--muted);
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .badge.on {
      border-color: var(--accent);
      color: var(--accent);
      background: rgba(95, 255, 176, 0.06);
    }

    /* Key metrics */
    .key-metrics {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      margin-bottom: 1.5rem;
    }

    @media (max-width: 520px) {
      .key-metrics {
        grid-template-columns: 1fr;
      }
    }

    .key-metric {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 1rem 1.1rem;
      transition: background 0.3s, border-color 0.3s;
    }

    .km-label {
      font-size: 0.8rem;
      color: var(--muted);
      letter-spacing: 0.06em;
      margin-bottom: 0.4rem;
    }

    .km-value {
      font-family: Arial, Helvetica, sans-serif;
      font-size: clamp(1.1rem, 2vw, 1.45rem);
      font-weight: 700;
      line-height: 1;
    }

    .km-value.green {
      color: var(--accent);
    }

    .km-value.blue {
      color: var(--accent2);
    }

    .km-value.yellow {
      color: var(--yellow);
    }

    /* Breakdown */
    .breakdown-title {
      font-size: 1rem;
      color: var(--muted);
      letter-spacing: 0.15em;
      text-transform: uppercase;
      margin-bottom: 0.6rem;
    }

    .breakdown-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0 2rem;
    }

    @media (max-width: 520px) {
      .breakdown-grid {
        grid-template-columns: 1fr;
      }
    }

    .brow {
      display: flex;
      justify-content: space-between;
      font-size: 0.9rem;
      padding: 0.3rem 0;
      border-bottom: 1px solid var(--border);
    }

    .brow span:first-child {
      color: var(--muted);
    }

    .brow span:last-child {
      color: var(--text);
    }

    .footer-note {
      margin-top: 1rem;
      font-size: 0.9rem;
      color: var(--muted);
      border-top: 1px solid var(--output-border);
      padding-top: 0.75rem;
      line-height: 1.8;
    }

    .footer-note strong {
      color: var(--text);
    }

    @keyframes fadeUp {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .animated {
      animation: fadeUp 0.3s ease;
    }

/* ── MOBILE SIDEBAR RESPONSIVE ── */
.sidebar-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .intranet-layout {
    flex-direction: column;
  }

  .sidebar-toggle {
    display: flex;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 998;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #13753d;
    color: #fff;
    border: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: opacity 0.3s;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    max-width: 80vw;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  }
  
  .sidebar.open {
    left: 0;
  }

  .sidebar-logo {
    position: relative;
    padding-right: 40px;
  }

  .sidebar-close {
    display: flex;
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .sidebar-backdrop.show {
    display: block;
  }
  
  .intranet-content {
    padding-top: 5rem;
    padding: 5rem 5px 5rem 5px;
  }
}
