:root {
    --bg: #08111d;
    --panel: rgba(16, 28, 48, 0.9);
    --panel-strong: #10203a;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: #8ea3bd;
    --green: #1fc8a0;
    --blue: #2a7cff;
    --orange: #ff9f5a;
    --danger: #ff6d6d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(42, 124, 255, 0.22), transparent 35%),
        radial-gradient(circle at top right, rgba(31, 200, 160, 0.16), transparent 28%),
        linear-gradient(180deg, #09111f 0%, #07101a 100%);
    overflow-x: hidden;
}

.auth-body,
.dashboard-body {
    min-height: 100vh;
}

.auth-shell,
.dashboard-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.auth-shell {
    display: grid;
    gap: 24px;
    align-items: stretch;
    min-height: 100vh;
    grid-template-columns: 1.2fr 0.9fr;
}

.hero-panel,
.auth-card,
.panel,
.hero-card,
.metric-card,
.reading-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.hero-panel {
    padding: 42px;
    min-width: 0;
}

.hero-panel h1,
.topbar h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-panel p,
.topbar p,
.hero-card p {
    color: var(--muted);
    line-height: 1.65;
}

.hero-badge {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(31, 200, 160, 0.16);
    color: var(--green);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.auth-card {
    padding: 28px;
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
}

.auth-card h2,
.panel-head h3,
.hero-card h2 {
    margin: 0;
}

.panel-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

label {
    color: var(--muted);
    font-size: 0.95rem;
    display: block;
    margin-bottom: -2px;
}

input,
select,
button {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px 16px;
    font: inherit;
}

input,
select {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    min-height: 50px;
}

select option {
    color: var(--text);
    background: #16243a;
}

button,
.ghost-link {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-link {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px 16px;
    font: inherit;
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-small {
    padding: 10px 14px;
    border-radius: 12px;
}

.button-secondary {
    background: rgba(42, 124, 255, 0.16);
}

.button-danger {
    background: rgba(255, 109, 109, 0.18);
}

.form-intro {
    margin: 0 0 4px;
    color: var(--muted);
    line-height: 1.6;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -32px calc(50% - 50vw) 20px;
    padding: 10px 32px;
    background: rgba(8, 17, 29, 0.94);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.site-header-main {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: 0 auto;
    width: min(1400px, calc(100% - 32px));
}

.site-title {
    margin: 0;
    flex: 0 0 auto;
    font-size: 1.22rem;
    line-height: 1.1;
}

.top-menu-toggle {
    margin-left: auto;
}

.top-nav {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.top-nav .nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 0.92rem;
}

.top-nav .nav-link:hover,
.top-nav .nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.top-nav .nav-link-active {
    background: rgba(42, 124, 255, 0.16);
    border-color: rgba(42, 124, 255, 0.28);
    color: var(--text);
}

.top-nav .nav-signout-link {
    margin-left: auto;
}

.menu-toggle {
    display: none;
    width: auto;
    min-width: 0;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    flex-direction: column;
    align-items: center;
}

.menu-toggle span {
    display: block;
}

.menu-toggle span:nth-child(-n+3) {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-toggle span:last-child {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 18px;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.sidebar-backdrop {
    display: none;
}

.sidebar-title {
    margin: 10px 0 8px;
    font-size: 1.7rem;
}

.sidebar-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.nav-link-active {
    background: linear-gradient(135deg, rgba(31, 200, 160, 0.22), rgba(42, 124, 255, 0.2));
    border-color: rgba(42, 124, 255, 0.35);
}

.content-area {
    min-width: 0;
}

.meter-label-stack {
    display: grid;
    gap: 6px;
}

.meter-image-link,
.meter-image-missing {
    position: relative;
    display: inline-flex;
    width: fit-content;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
}

.meter-image-link {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.meter-image-link:hover,
.meter-image-link:focus-visible {
    color: #7fb2ff;
}

.meter-image-missing {
    color: var(--muted);
    text-decoration: none;
}

.meter-image-preview {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    display: none;
    width: 220px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 17, 29, 0.96);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.34);
    z-index: 12;
}

.meter-image-preview img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

@media (hover: hover) and (pointer: fine) {
    .meter-image-link:hover .meter-image-preview,
    .meter-image-link:focus-visible .meter-image-preview {
        display: block;
    }
}

.hero-grid,
.panel-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 20px;
}

.hero-grid {
    grid-template-columns: 1.1fr 1.4fr;
}

.panel-grid {
    grid-template-columns: 1fr 1fr;
}

.hero-card,
.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-actions {
    margin-top: 14px;
}

.metric-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
    padding: 20px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 12px;
}

.metric-card strong {
    font-size: 2rem;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form.compact {
    margin-top: 12px;
}

.table-wrap {
    overflow-x: auto;
}

.users-table-wrap {
    overflow-x: auto;
}

.list-search-shell {
    width: min(320px, 100%);
}

.list-search-input {
    min-height: 48px;
    padding-right: 18px;
}

.users-table {
    width: 100%;
    table-layout: fixed;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 14%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 24%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    width: 14%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
    width: 22%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
    width: 30%;
}

.data-list-table tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}

.data-list-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.users-table tbody tr {
    transition: background 0.2s ease;
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.users-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.users-name-cell,
.users-email-cell {
    word-break: break-word;
}

.entity-primary strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.35;
}

.entity-secondary {
    color: var(--text);
    opacity: 0.92;
    line-height: 1.45;
}

.plant-cell {
    min-width: 0;
}

.plant-display {
    display: grid;
    gap: 4px;
}

.plant-display strong {
    display: block;
    font-size: 0.98rem;
    color: var(--text);
    line-height: 1.35;
}

.plant-display span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.users-actions-cell {
    min-width: 0;
}

.users-status-cell {
    white-space: nowrap;
}

.users-actions-cell,
.data-list-table td:last-child {
    white-space: nowrap;
}

.report-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 180px);
    gap: 12px;
    align-items: end;
}

.report-filter-form-dashboard {
    grid-template-columns: minmax(240px, 320px) minmax(280px, 1fr);
    gap: 16px;
    align-items: end;
}

.report-filter-field {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.report-filter-field label {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-filter-field input {
    min-height: 52px;
}

.report-filter-actions {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.report-filter-actions .button-link,
.report-filter-actions button {
    min-height: 56px;
}

.log-filter-form {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 180px);
}

.summary-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(0, 180px);
    gap: 12px;
    align-items: end;
}

.dashboard-overview-panel {
    display: grid;
    gap: 22px;
}

.dashboard-overview-top {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.3fr);
    gap: 20px;
    align-items: end;
}

.dashboard-overview-copy {
    display: grid;
    gap: 10px;
    align-content: start;
}

.dashboard-overview-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(42, 124, 255, 0.12);
    color: #9ec2ff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-overview-copy h3 {
    margin: 0;
}

.dashboard-overview-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.report-summary-panel,
.report-panel,
.chart-panel {
    margin-bottom: 20px;
}

.report-meta-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-meta-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.report-meta-card-wide {
    grid-column: span 2;
}

.report-meta-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 0.88rem;
}

.report-meta-card strong {
    font-size: 1.15rem;
    line-height: 1.5;
    word-break: break-word;
}

.report-submitted-by {
    display: block;
    white-space: normal;
    line-height: 1.65;
}

.report-submitted-by-list {
    display: grid;
    gap: 10px;
}

.report-submitter-item {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.report-submitter-shift {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-submitter-name {
    display: block;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.report-submitted-by-empty {
    color: var(--muted);
    line-height: 1.6;
}

.report-table-wrap {
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.report-table {
    min-width: 860px;
}

.report-table thead th {
    background: rgba(255, 255, 255, 0.04);
}

.report-table th[scope="row"] {
    min-width: 240px;
    color: var(--text);
    font-size: 0.94rem;
}

.phase-report-table td,
.phase-report-table th,
.pump-report-table td,
.pump-report-table th,
.report-table td,
.report-table th {
    text-align: center;
}

.phase-report-table th:first-child,
.report-table th[scope="row"] {
    text-align: left;
}

.operating-parameter-table th[scope="row"] {
    min-width: 220px;
}

.operating-parameter-table td {
    min-width: 150px;
    text-align: left;
    line-height: 1.55;
}

.sf6-report-table th,
.sf6-report-table td {
    text-align: center;
    min-width: 110px;
}

.meter-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 320px;
    padding: 12px 6px 4px;
}

.meter-chart-item {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.meter-chart-value {
    color: var(--muted);
    font-size: 0.82rem;
}

.meter-chart-track {
    width: 100%;
    min-height: 220px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--line);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
}

.meter-chart-bar {
    width: 100%;
    border-radius: 14px 14px 10px 10px;
    background: linear-gradient(180deg, var(--green), var(--blue));
    box-shadow: 0 18px 28px rgba(42, 124, 255, 0.18);
}

.meter-chart-label {
    color: var(--text);
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.empty-state {
    padding: 28px 20px;
    border-radius: 20px;
    border: 1px dashed var(--line);
    color: var(--muted);
    text-align: center;
}

.summary-chart-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.summary-chart-card {
    min-width: 0;
}

.summary-chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.summary-svg-chart {
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-chart-enlarge {
    width: auto;
    min-width: 0;
    margin-top: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--blue);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.summary-chart-enlarge:hover,
.summary-chart-enlarge:focus-visible {
    color: #7fb2ff;
}

.summary-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 14px;
}

.summary-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.summary-svg {
    display: block;
    width: 100%;
    height: auto;
}

.summary-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.summary-line {
    fill: none;
    stroke: #2a7cff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.summary-point {
    fill: #1fc8a0;
    stroke: #08111d;
    stroke-width: 2;
}

.summary-axis-label {
    fill: #8ea3bd;
    font-size: 12px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.summary-value-label {
    fill: #f5f7fb;
    font-size: 11px;
    font-weight: 700;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.report-export-body {
    background: #f4f7fb;
    color: #10203a;
}

.report-export-body .dashboard-shell {
    width: min(1400px, calc(100% - 32px));
}

.export-topbar {
    margin-bottom: 10px;
}

.export-hidden {
    display: none !important;
}

.pdf-report-sheet {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d6deea;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.pdf-report-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.pdf-report-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #2563eb;
    text-transform: uppercase;
}

.pdf-report-header h2 {
    margin: 8px 0 0;
    font-size: 1.85rem;
    color: #0f172a;
}

.pdf-report-meta-mini {
    display: grid;
    gap: 6px;
    color: #475569;
    font-size: 0.92rem;
    text-align: right;
}

.pdf-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.pdf-meta-table,
.pdf-grid-table {
    width: 100%;
    border-collapse: collapse;
}

.pdf-meta-table th,
.pdf-meta-table td,
.pdf-grid-table th,
.pdf-grid-table td {
    border: 1px solid #1e293b;
    padding: 8px 10px;
    color: #0f172a;
    vertical-align: middle;
    background: #ffffff;
}

.pdf-meta-table th,
.pdf-grid-table th {
    font-size: 0.88rem;
    font-weight: 700;
}

.pdf-meta-table td,
.pdf-grid-table td {
    font-size: 0.87rem;
    line-height: 1.45;
}

.pdf-section-title {
    margin: 18px 0 8px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #0f172a;
}

.pdf-grid-table .row-heading {
    min-width: 210px;
    text-align: left;
}

.pdf-monitoring-line {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 12px 0 16px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
}

.pdf-two-column {
    display: grid;
    grid-template-columns: 1.7fr 0.9fr;
    gap: 18px;
    align-items: start;
}

.notes-table th,
.notes-table td {
    text-align: center;
}

.notes-table .notes-cell {
    text-align: left;
    min-height: 80px;
}

.operating-sheet-table td:last-child,
.operating-sheet-table th:last-child {
    min-width: 230px;
}

.pump-sheet-table th,
.pump-sheet-table td {
    text-align: center;
    min-width: 70px;
}

.pdf-signature-table {
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.pill-green {
    background: rgba(31, 200, 160, 0.18);
    color: var(--green);
}

.pill-orange {
    background: rgba(255, 159, 90, 0.18);
    color: var(--orange);
}

.action-stack {
    display: grid;
    gap: 10px;
    min-width: min(280px, 100%);
}

.user-action-stack {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
}

.compact-action-stack {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.action-inline-form {
    margin: 0;
}

.inline-form {
    display: grid;
    gap: 10px;
}

.assign-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-width: 0;
}

.assign-inline-form select {
    min-width: 0;
    width: 140px;
    min-height: 42px;
    padding: 10px 14px;
    padding-right: 40px;
    border-radius: 14px;
}

.assign-inline-form .button-small,
.action-chip {
    width: auto;
    min-width: 88px;
    min-height: 42px;
    padding: 10px 14px;
}

.icon-button {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
}

.icon-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.edit-box summary {
    cursor: pointer;
    color: var(--muted);
    padding: 8px 0;
}

.user-edit-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    padding: 0 14px 14px;
}

.user-edit-box summary {
    color: var(--text);
    font-weight: 600;
}

.button-outline {
    background: rgba(42, 124, 255, 0.1);
    border-color: rgba(42, 124, 255, 0.32);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal-shell {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 80;
}

.modal-shell.modal-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(7, 16, 26, 0.78);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px;
    background: #122038;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.modal-card-wide {
    width: min(1100px, 100%);
}

.mobile-meter-image-card {
    width: min(520px, 100%);
}

.mobile-meter-image-frame {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
}

.mobile-meter-image-frame img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 220px);
    object-fit: contain;
    border-radius: 14px;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.modal-head h3 {
    margin: 0;
}

.modal-close {
    width: auto;
    min-width: 46px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 1.4rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.06);
}

body.modal-active {
    overflow: hidden;
}

.summary-chart-meta-expanded {
    margin-bottom: 18px;
}

.summary-svg-chart-expanded {
    padding: 16px;
}

.summary-chart-legend-expanded {
    margin-top: 18px;
}

.reading-list {
    display: grid;
    gap: 12px;
}

.reading-card {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.reading-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.reading-meta {
    display: grid;
    gap: 6px;
    text-align: right;
    color: var(--muted);
    font-size: 0.92rem;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.flash-success {
    background: rgba(31, 200, 160, 0.18);
    border: 1px solid rgba(31, 200, 160, 0.3);
}

.flash-error {
    background: rgba(255, 109, 109, 0.18);
    border: 1px solid rgba(255, 109, 109, 0.3);
}

@media (max-width: 960px) {
    .auth-shell,
    .hero-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        min-height: auto;
        padding-top: 24px;
    }

    .hero-panel,
    .auth-card {
        padding: 28px 22px;
        border-radius: 24px;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-meta-card-wide {
        grid-column: span 2;
    }

    .summary-chart-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-overview-top {
        grid-template-columns: 1fr;
    }

    .site-header-main {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .list-search-shell {
        width: 100%;
    }

    .pdf-meta-grid,
    .pdf-two-column {
        grid-template-columns: 1fr;
    }

    .reading-card,
    .topbar {
        flex-direction: column;
    }

    .reading-meta {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .site-header-main {
        flex-wrap: wrap;
        width: 100%;
        gap: 12px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-shell,
    .auth-shell {
        width: min(100% - 24px, 1200px);
        padding: 18px 0 32px;
    }

    .hero-panel {
        padding: 24px 18px;
    }

    .hero-panel h1,
    .topbar h1 {
        font-size: 2rem;
    }

    .auth-card,
    .hero-card,
    .panel,
    .metric-card,
    .reading-card {
        border-radius: 22px;
    }

    .auth-card,
    .panel,
    .hero-card {
        padding: 18px;
    }

    .topbar {
        margin-bottom: 16px;
    }

    .site-header {
        margin: -18px calc(50% - 50vw) 18px;
        padding: 10px 16px;
        border-radius: 0 0 18px 18px;
    }

    .site-title {
        font-size: 1.1rem;
    }

    .top-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        padding: 10px 12px;
        border-radius: 14px;
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.05);
        color: var(--text);
        min-height: auto;
    }

    .top-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        overflow: visible;
        justify-content: flex-start;
        padding-top: 8px;
        order: 3;
        flex-basis: 100%;
        width: 100%;
    }

    body.topnav-open .top-nav {
        display: flex;
    }

    .top-nav .nav-link {
        width: 100%;
        white-space: normal;
        justify-content: flex-start;
        text-align: left;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .top-nav .nav-signout-link {
        margin-left: 0;
    }

    .sidebar {
        padding: 18px;
        border-radius: 22px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(7, 16, 26, 0.62);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 20;
    }

    .sidebar {
        position: fixed;
        top: 12px;
        left: 12px;
        bottom: 12px;
        width: min(320px, calc(100vw - 24px));
        overflow-y: auto;
        z-index: 30;
        transform: translateX(calc(-100% - 20px));
        transition: transform 0.24s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .report-filter-form,
    .report-meta-grid,
    .summary-filter-form {
        grid-template-columns: 1fr;
    }

    .report-meta-card-wide {
        grid-column: auto;
    }

    .report-submitter-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .report-filter-form-dashboard,
    .report-filter-actions {
        grid-template-columns: 1fr;
    }

    .panel-head {
        margin-bottom: 14px;
        flex-direction: column;
    }

    .ghost-link {
        width: 100%;
        min-height: 48px;
    }

    table:not(.report-table),
    table:not(.report-table) thead,
    table:not(.report-table) tbody,
    table:not(.report-table) th,
    table:not(.report-table) td,
    table:not(.report-table) tr {
        display: block;
    }

    table:not(.report-table) thead {
        display: none;
    }

    .table-wrap {
        overflow: visible;
    }

    table:not(.report-table) tbody {
        display: grid;
        gap: 14px;
    }

    table:not(.report-table) tr {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--line);
        border-radius: 20px;
        padding: 14px;
    }

    table:not(.report-table) td {
        border-bottom: 0;
        padding: 8px 0;
    }

    table:not(.report-table) td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 0.84rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .action-stack {
        min-width: 0;
    }

    .users-table,
    .users-table thead,
    .users-table tbody,
    .users-table th,
    .users-table td,
    .users-table tr {
        display: block;
    }

    .users-table thead {
        display: none;
    }

    .users-table tbody {
        display: grid;
        gap: 14px;
    }

    .users-table tr {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--line);
        border-radius: 20px;
        padding: 14px;
    }

    .users-table td {
        width: auto !important;
        border-bottom: 0;
        padding: 8px 0;
    }

    .users-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 0.84rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .inline-form,
    .stack-form.compact {
        gap: 12px;
    }

    .user-action-stack {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .assign-inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .assign-inline-form select,
    .assign-inline-form .button-small {
        width: 100%;
    }

    .icon-button {
        width: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .modal-shell {
        padding: 14px;
    }

    .modal-card {
        padding: 18px;
        border-radius: 20px;
    }

    .mobile-meter-image-frame {
        padding: 10px;
    }

    .button-small,
    button,
    input,
    select {
        min-height: 48px;
    }

    .reading-card {
        padding: 14px;
    }

    .report-table-wrap {
        overflow-x: auto;
    }

    .report-table th,
    .report-table td {
        white-space: nowrap;
        min-width: 84px;
    }

    .report-table th[scope="row"],
    .phase-report-table th:first-child {
        min-width: 200px;
        position: sticky;
        left: 0;
        background: var(--panel-strong);
        z-index: 1;
    }

    .meter-chart {
        grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
        min-height: 260px;
    }

    .meter-chart-track {
        min-height: 180px;
    }
}

@media print {
    body.report-export-body {
        background: #ffffff;
    }

    .report-export-body .topbar,
    .report-export-body .flash {
        display: none;
    }

    .report-export-body .panel,
    .report-export-body .hero-card,
    .report-export-body .metric-card {
        box-shadow: none;
        border: 1px solid #d6deea;
        background: #ffffff;
        color: #10203a;
    }

    .report-export-body .panel-copy,
    .report-export-body .report-meta-card span,
    .report-export-body .meter-chart-value,
    .report-export-body .meter-chart-label,
    .report-export-body th {
        color: #51637c;
    }

    .report-export-body .meter-chart-track {
        background: #eef3f9;
        border-color: #d6deea;
    }

    .report-export-body .meter-chart-bar {
        box-shadow: none;
    }

    .pdf-report-sheet {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .pdf-meta-table th,
    .pdf-meta-table td,
    .pdf-grid-table th,
    .pdf-grid-table td {
        border-color: #111827;
    }
}
