/* assets/style.css */

:root {
    --green: #173f35;
    --green-2: #245c4e;
    --gold: #b99155;
    --cream: #fbf6ea;
    --paper: #fffdf8;
    --text: #27322e;
    --muted: #68736e;
    --border: #e4d8c4;
    --danger: #9f2d2d;
    --success: #276a45;
    --shadow: 0 20px 55px rgba(23, 63, 53, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, var(--cream), #ffffff);
    color: var(--text);
}

a {
    color: inherit;
}

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 18px 56px;
}

.topbar,
.simple-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    background: var(--green);
    color: white;
    border-radius: 24px;
    padding: 34px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.simple-header {
    background: white;
    color: var(--green);
    border: 1px solid var(--border);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 700;
}

h1, h2, h3, p {
    margin-top: 0;
}

.topbar h1,
.simple-header h1 {
    font-size: clamp(28px, 4vw, 44px);
    margin-bottom: 12px;
}

.subtitle {
    max-width: 780px;
    color: rgba(255,255,255,.85);
    font-size: 17px;
    line-height: 1.55;
    margin-bottom: 0;
}

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

.top-actions a {
    text-decoration: none;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: white;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    white-space: nowrap;
}

.top-actions.dark a {
    background: var(--cream);
    color: var(--green);
    border: 1px solid var(--border);
}

.card,
.login-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
}

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

.login-card {
    width: min(460px, 100%);
}

.muted,
.hint {
    color: var(--muted);
    line-height: 1.5;
}

.section {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.section:last-child {
    border-bottom: 0;
}

.section h2 {
    color: var(--green);
    margin-bottom: 16px;
}

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

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

label {
    display: block;
    font-weight: 700;
    color: var(--green);
}

input,
textarea,
.select-field {
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    background: #fffdf9;
}

textarea {
    resize: vertical;
}

.kits-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.kit-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: var(--paper);
    cursor: pointer;
    transition: .2s ease;
}

.kit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(23, 63, 53, .10);
}

.kit-card input {
    width: auto;
    margin-right: 8px;
}

.kit-name {
    display: block;
    font-size: 18px;
    margin: 8px 0;
    color: var(--green);
}

.kit-desc {
    display: block;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.45;
}

.products-box {
    display: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: #fffdf9;
}

.product-row {
    padding: 18px 0;
    border-top: 1px solid var(--border);
}

.product-row:first-of-type {
    border-top: 0;
}

.check-line {
    color: var(--text);
}

.check-line input {
    width: auto;
    margin-right: 8px;
}

.check-line span,
.product-note {
    color: var(--muted);
    font-weight: 400;
}

.product-note {
    margin: 8px 0 0 26px;
    line-height: 1.45;
}

.badge {
    display: inline-block;
    margin-left: 8px;
    background: var(--cream);
    color: var(--green);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-style: normal;
}

.small-label {
    margin-top: 12px;
    font-size: 13px;
}

.actions,
.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 24px;
}

button,
.primary,
.whatsapp,
.secondary,
.secondary-link,
.mini-btn {
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    display: inline-block;
}

.primary {
    background: var(--green);
    color: white;
}

.primary.full {
    width: 100%;
}

.whatsapp {
    background: #1faa59;
    color: white;
}

.secondary,
.secondary-link {
    background: #efe7d8;
    color: var(--green);
}

.mini-btn {
    padding: 8px 12px;
    background: var(--green);
    color: white;
    font-size: 13px;
}

.gold-mini {
    background: var(--gold);
}

.danger-mini {
    background: var(--danger);
}

.secondary-mini {
    background: var(--cream);
    color: var(--green);
    border: 1px solid var(--border);
}

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff0f0;
    color: var(--danger);
    border: 1px solid #eccaca;
    margin-bottom: 16px;
}

.alert.success {
    background: #eef8f2;
    color: var(--success);
    border-color: #cce7d6;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    color: var(--green);
    background: var(--cream);
}

.table-muted {
    color: var(--muted);
    font-size: 13px;
}

.nowrap {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.checkbox-group {
    display: grid;
    gap: 8px;
    align-content: center;
}

.checkbox-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--green);
}

.checkbox-admin input {
    width: auto;
    margin: 0;
}

/* Receituário */

.print-body {
    background: #eeeeee;
}

.toolbar {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 16px;
}

.prescription {
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    background: white;
    padding: 18mm;
    color: #1d2925;
    box-shadow: 0 10px 35px rgba(0,0,0,.15);
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid var(--green);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.prescription-header h1 {
    color: var(--green);
    font-size: 24px;
    margin-bottom: 6px;
}

.prescription-header p {
    margin-bottom: 4px;
    color: var(--muted);
}

.brand-box {
    border: 1px solid var(--gold);
    border-radius: 14px;
    padding: 14px;
    min-width: 170px;
    text-align: center;
    color: var(--green);
}

.brand-box strong {
    display: block;
    font-size: 18px;
}

.brand-box span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.patient-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    background: var(--cream);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 28px;
}

.patient-line p {
    margin: 0;
}

.eyebrow-print {
    color: var(--gold);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    margin-bottom: 8px;
}

.prescription h2 {
    color: var(--green);
    font-size: 26px;
    margin-bottom: 8px;
}

.kit-description {
    color: var(--muted);
    line-height: 1.5;
}

.rx-list {
    margin-top: 24px;
}

.rx-item {
    border-left: 4px solid var(--gold);
    padding: 12px 0 12px 16px;
    margin-bottom: 16px;
}

.rx-item h3 {
    color: var(--green);
    font-size: 18px;
    margin-bottom: 8px;
}

.rx-item h3 span {
    color: var(--muted);
    font-weight: 400;
}

.rx-item p {
    line-height: 1.55;
}

.obs-box {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-top: 20px;
}

.signature {
    margin-top: 56px;
    text-align: center;
}

.signature .line {
    width: 270px;
    border-top: 1px solid #333;
    margin: 0 auto 8px;
}

.prescription-footer {
    margin-top: 42px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .grid.two,
    .kits-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .topbar,
    .simple-header {
        padding: 22px;
        border-radius: 18px;
    }

    .topbar,
    .simple-header {
        flex-direction: column;
    }

    .prescription {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 20px;
        box-shadow: none;
    }

    .prescription-header,
    .patient-line {
        flex-direction: column;
    }
}

@media print {
    body {
        background: white;
    }

    .no-print {
        display: none !important;
    }

    .prescription {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 16mm;
        box-shadow: none;
    }

    @page {
        size: A4;
        margin: 0;
    }
}

.alert.error { background: #fff0f0; color: var(--danger); border-color: #eccaca; }


/* V5 — Produto: preço, disponibilidade e posologia padrão */
.admin-check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 18px;
}
.product-price {
    margin: 8px 0 0 26px;
    color: #173f35;
    font-size: 13px;
    font-weight: 700;
}
.product-unavailable {
    opacity: 0.72;
    background: #fff8f5;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 12px;
}
.danger-badge {
    background: #fff0f0;
    color: #9f2d2d;
    border-color: #eccaca;
}
@media (max-width: 760px) {
    .admin-check-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Ajustes específicos da tela de login
   ========================================================= */

.login-card-custom {
    padding: 34px 30px;
}

.login-title-block {
    text-align: center;
    margin-bottom: 26px;
}

.login-title-block .eyebrow {
    margin-bottom: 10px;
}

.login-title-block h1 {
    color: var(--green);
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: 0.04em;
    margin: 0 0 14px 0;
}

.login-title-block h1 span {
    display: block;
    color: var(--gold);
    font-size: 15px;
    letter-spacing: 0.14em;
    margin-top: 7px;
}

.login-title-block .muted {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.5;
}

.login-field {
    margin-bottom: 18px;
}

.login-submit {
    margin-top: 8px;
}
