:root {
  --deep-blue: #0b3d5c;
  --blue: #1467a3;
  --bright-blue: #2596d9;
  --deep-green: #0e6b4f;
  --green: #189d6f;
  --bright-green: #2ecc8f;
  --bg: #f2f7f6;
  --card-bg: #ffffff;
  --text-dark: #142a2e;
  --text-muted: #5c7378;
  --border: #dbe7e4;
  --warn: #d9a125;
  --danger: #d9534f;
  --shadow: 0 4px 16px rgba(11, 61, 92, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #eef6f4 0%, #eaf3f8 100%);
  color: var(--text-dark);
  min-height: 100vh;
}

.header-logo {
    width: 90px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--deep-blue); text-decoration: underline; }

/* ---------- Top navigation ---------- */
.app-header {
  background: linear-gradient(90deg, var(--deep-blue) 0%, var(--deep-green) 100%);
  color: #fff;
  padding: 0 24px;
  box-shadow: var(--shadow);
}

.app-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.brand .brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bright-green), var(--bright-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--deep-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

.nav-links a.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
}

.btn-logout {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ---------- Page container ---------- */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--deep-blue);
  margin-bottom: 4px;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-header-row .page-title,
.page-header-row .page-subtitle {
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--deep-blue));
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(20, 103, 163, 0.4); }

.btn-accent {
  background: linear-gradient(90deg, var(--green), var(--deep-green));
  color: #fff;
}
.btn-accent:hover { box-shadow: 0 4px 14px rgba(24, 157, 111, 0.4); }

.btn-secondary {
  background: #fff;
  color: var(--deep-blue);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f5f9f8; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Login page ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(37,150,217,0.12), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(46,204,143,0.14), transparent 45%),
              linear-gradient(135deg, #0b3d5c 0%, #0e6b4f 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  padding: 40px 36px;
}

.login-logo-old {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bright-green), var(--bright-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 auto 18px;
}

.login-logo {
    width: 156px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0 auto 18px;
}

.login-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--deep-blue);
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--bright-blue);
  box-shadow: 0 0 0 3px rgba(37,150,217,0.15);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.demo-hint {
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eef6f4;
  border: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.validation-summary {
  background: #fdecea;
  border: 1px solid #f3c1bf;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.field-validation-error { color: var(--danger); font-size: 0.8rem; }

/* ---------- Tables ---------- */
.table-wrapper {
  overflow: auto;
  max-height: 65vh; /* only the rows scroll within this box - adjust as needed */
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 12px 14px;
  background: #eef6f4;
  color: var(--deep-blue);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: #f7fbfa; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-active { background: #e2f7ed; color: var(--deep-green); }
.badge-maintenance { background: #fff4de; color: #a6720d; }
.badge-decommissioned { background: #f1f1f1; color: #6b6b6b; }
.badge-leak { background: #fdecea; color: var(--danger); }
.badge-ok { background: #e2f7ed; color: var(--deep-green); }

/* ---------- Asset grid summary cards ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.summary-card .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.summary-card .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--deep-blue);
}

.summary-card.green .value { color: var(--deep-green); }

/* ---------- Breadcrumb / back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 16px;
}

/* ---------- Alerts / empty states ---------- */
.alert-info {
  background: #eaf4fb;
  border: 1px solid #cfe6f7;
  color: var(--deep-blue);
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ---------- Filter form (FGas log search) ---------- */
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.page-title-company {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}