:root {
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

* {
    -webkit-tap-highlight-color: transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: rgba(255, 255, 255, 0.66);
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item:focus-visible,
.icon-button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 2px solid #01696f;
    outline-offset: 2px;
}

.nav-item svg,
.btn-primary svg,
.btn-secondary svg,
.metric-icon svg,
.icon-button svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.nav-item span {
    display: none;
}

@media (min-width: 1024px) {
    .nav-item span {
        display: inline;
    }
}

.surface-card,
.card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(23, 22, 20, 0.08);
}

[data-theme="dark"] .surface-card,
[data-theme="dark"] .card {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card-pad {
    padding: 1.25rem;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.btn-primary {
    border-radius: 9999px;
    background: #01696f;
    padding: 0.625rem 1rem;
    color: white;
    box-shadow: 0 10px 20px rgba(1, 105, 111, 0.18);
}

.btn-primary:hover {
    background: #01565b;
}

.btn-secondary {
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.625rem 1rem;
    color: rgb(28 25 23);
}

.btn-secondary:hover {
    background: white;
    border-color: rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .btn-secondary {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    border-radius: 9999px;
    background: rgb(190 18 60);
    padding: 0.625rem 1rem;
    color: white;
}

.btn-danger:hover {
    background: rgb(159 18 57);
}

.icon-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.95);
    color: rgb(28 25 23);
}

.icon-button:hover {
    background: white;
}

[data-theme="dark"] .icon-button {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

[data-theme="dark"] .icon-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.page-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: rgb(28 25 23);
}

[data-theme="dark"] .page-title {
    color: rgb(250 250 249);
}

.money-hidden {
    letter-spacing: 0.12em;
    user-select: none;
}

.metric-icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .metric-icon {
    background: rgba(255, 255, 255, 0.08);
}

.table-wrap {
    overflow-x: auto;
}

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

.data-table thead {
    color: rgb(68 64 60);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

[data-theme="dark"] .data-table thead {
    color: rgb(168 162 158);
}

.data-table th,
.data-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    padding: 0.875rem 1rem;
    text-align: left;
    white-space: nowrap;
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
    border-color: rgba(255, 255, 255, 0.1);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.62);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:hover {
    background: rgba(1, 105, 111, 0.07);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(1, 105, 111, 0.16);
}

.text-end {
    text-align: right !important;
}

.text-muted {
    color: rgb(87 83 78);
}

[data-theme="dark"] .text-muted {
    color: rgb(168 162 158);
}

form input,
form select,
form textarea {
    display: block;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: rgba(255, 255, 255, 0.98);
    padding: 0.75rem 0.875rem;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000 !important;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

html[data-theme="dark"] form input,
html[data-theme="dark"] form select,
html[data-theme="dark"] form textarea,
html.dark form input,
html.dark form select,
html.dark form textarea {
    border-color: rgba(255, 255, 255, 0.12) !important;
    background-color: rgb(245 245 244) !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000 !important;
}

html[data-theme="dark"] form input::placeholder,
html[data-theme="dark"] form textarea::placeholder,
html.dark form input::placeholder,
html.dark form textarea::placeholder {
    color: rgb(120 113 108) !important;
    -webkit-text-fill-color: rgb(120 113 108) !important;
}

html[data-theme="dark"] form select option,
html.dark form select option,
form select option {
    background-color: rgb(245 245 244) !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #01696f;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    box-shadow: 0 0 0 4px rgba(1, 105, 111, 0.12);
}

form input:-webkit-autofill,
form textarea:-webkit-autofill,
form select:-webkit-autofill {
    -webkit-text-fill-color: #000 !important;
    box-shadow: 0 0 0 1000px rgb(245 245 244) inset !important;
    caret-color: #000 !important;
}

.action-link {
    font-weight: 700;
    color: #01696f;
    text-underline-offset: 4px;
}

.action-link:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.625rem;
    color: rgb(68 64 60);
    font-size: 0.75rem;
    font-weight: 700;
}

.status-good {
    border-color: rgba(5, 150, 105, 0.18);
    background: rgba(236, 253, 245, 0.9);
    color: rgb(4 120 87);
}

.status-danger {
    border-color: rgba(225, 29, 72, 0.18);
    background: rgba(255, 241, 242, 0.9);
    color: rgb(190 18 60);
}

[data-theme="dark"] .status-badge {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgb(214 211 209);
}

[data-theme="dark"] .status-good {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(6, 78, 59, 0.28);
    color: rgb(110 231 183);
}

[data-theme="dark"] .status-danger {
    border-color: rgba(251, 113, 133, 0.2);
    background: rgba(136, 19, 55, 0.28);
    color: rgb(253 164 175);
}

.empty-state {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 2rem 0.5rem;
    color: rgb(87 83 78);
}

.empty-state > span {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 9999px;
    background: rgba(1, 105, 111, 0.1);
    color: #01696f;
}

.empty-state strong {
    display: block;
    color: rgb(28 25 23);
    font-size: 1rem;
}

.empty-state p {
    margin-top: 0.25rem;
    white-space: normal;
    color: rgb(120 113 108);
}

.empty-state svg,
.status-badge svg {
    width: 1rem;
    height: 1rem;
}

[data-theme="dark"] .empty-state {
    color: rgb(214 211 209);
}

[data-theme="dark"] .empty-state > span {
    background: rgba(1, 105, 111, 0.22);
}

[data-theme="dark"] .empty-state strong {
    color: rgb(250 250 249);
}

[data-theme="dark"] .empty-state p {
    color: rgb(168 162 158);
}

.helptext,
.form-text {
    color: rgb(87 83 78);
    font-size: 0.875rem;
}

[data-theme="dark"] .helptext,
[data-theme="dark"] .form-text {
    color: rgb(168 162 158);
}

.errorlist {
    margin-top: 0.25rem;
    color: rgb(190 18 60);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .data-table {
        font-size: 0.8125rem;
    }
}
