﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
    background: #f3f4f6;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
    margin: 0 0 4px;
    color: #0f766e;
}

.login-card p {
    margin: 0 0 24px;
    color: #6b7280;
}

label {
    display: block;
    margin-bottom: 16px;
    font-weight: 700;
}

input {
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
}

select,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    margin: 0;
}

button,
.button {
    display: inline-block;
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: #0f766e;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.icon-button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    line-height: 1;
}

.icon-button.danger {
    background: #fee2e2;
    color: #991b1b;
}

.icon-button:hover {
    filter: brightness(0.96);
}

.alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fee2e2;
    color: #991b1b;
}

.notice {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #dcfce7;
    color: #166534;
}

.page {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 24px;
}

.wide-page {
    max-width: 1180px;
}

.panel {
    margin-bottom: 20px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.topbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.topbar-menu {
    position: relative;
}

.topbar a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    color: #374151;
    font-weight: 700;
    text-decoration: none;
}

.topbar-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    display: none;
    min-width: 170px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.topbar-menu:hover .topbar-submenu,
.topbar-menu:focus-within .topbar-submenu {
    display: grid;
    gap: 4px;
}

.topbar a.active,
.topbar a:hover {
    background: #0f766e;
    color: #ffffff;
}

.dashboard-hero {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 28px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 8px;
}

.dashboard-hero span {
    color: #5eead4;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.dashboard-hero h1 {
    margin: 8px 0;
    font-size: 34px;
}

.dashboard-hero p {
    margin: 0;
    color: #cbd5e1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.section-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-heading h1,
.panel h2 {
    margin: 0;
}

.section-heading p {
    margin: 6px 0 0;
    color: #6b7280;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-span,
.two-columns > button {
    grid-column: 1 / -1;
}

label span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

fieldset {
    margin: 0;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

legend {
    padding: 0 6px;
    font-weight: 700;
}

.checkbox-grid {
    display: grid;
    gap: 10px;
}

.check-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-weight: 400;
}

.image-preview {
    display: grid;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
}

.image-preview span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.image-preview img {
    display: block;
    max-width: min(260px, 100%);
    max-height: 140px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    object-fit: contain;
}

.inline-checks {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-top: 28px;
}

.inline-checks.no-padding {
    padding-top: 0;
}

.email-form-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
}

.compact-table {
    margin-top: 8px;
}

.whatsapp-row {
    padding-top: 31px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric {
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.metric span {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.metric strong {
    font-size: 20px;
}

.metric.featured {
    border-top: 4px solid #0f766e;
}

.metric.featured strong {
    font-size: 26px;
}

.quarter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}

.status-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    font-weight: 700;
}

.expense-form {
    display: grid;
    grid-template-columns: 1.1fr 0.7fr 0.9fr 1.4fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    color: #4b5563;
    font-size: 13px;
    text-transform: uppercase;
}

.actions-cell {
    width: 52px;
    text-align: right;
}

.actions-cell form {
    margin: 0;
}

.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pdf-menu {
    position: relative;
    display: inline-block;
}

.pdf-menu.compact {
    display: inline-flex;
}

.pdf-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 7;
    display: none;
    min-width: 190px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.pdf-options.align-right {
    right: 0;
    left: auto;
}

.pdf-menu:hover .pdf-options,
.pdf-menu:focus-within .pdf-options {
    display: grid;
    gap: 4px;
}

.pdf-options a,
.pdf-options button {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.pdf-options a:hover,
.pdf-options button:hover {
    background: #f3f4f6;
}

.quote-panel {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.quote-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.quote-selector {
    margin: 18px 0;
    border-top: 14px solid #f3f4f6;
    padding-top: 16px;
}

.selector-button,
.discount-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 10px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.selector-button span,
.discount-card span {
    color: #6b7280;
}

.selector-list {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.search-input {
    margin: 0 0 10px;
}

.select-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.select-row span {
    color: #6b7280;
    font-weight: 400;
}

.quote-items {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.quote-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.quote-item-row span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
}

.quantity-control .quantity-value {
    width: auto;
    min-width: 42px;
    padding: 0 10px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.muted-row {
    padding: 10px 12px;
    color: #6b7280;
}

.quote-totals {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.quote-totals > div,
.discount-card {
    border-radius: 8px;
}

.quote-totals > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.quote-totals span {
    color: #6b7280;
}

.save-bar {
    width: 100%;
    padding: 15px 18px;
    font-size: 16px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(520px, 100%);
    padding: 22px;
    border-radius: 8px;
    background: #ffffff;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.segmented label {
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 700;
}

.discount-preview {
    margin: 14px 0;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 700px) {
    .topbar,
    .section-heading,
    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-menu,
    .topbar-submenu {
        position: static;
    }

    .topbar-submenu {
        display: grid;
        gap: 4px;
        margin-left: 12px;
        box-shadow: none;
    }

    .two-columns,
    .dashboard-grid,
    .email-form-row,
    .quote-form-grid,
    .quote-item-row,
    .segmented,
    .summary-grid,
    .expense-form {
        grid-template-columns: 1fr;
    }

    .inline-checks {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 0;
    }
}
