.demo-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

.demo-main {
    flex: 1;
    margin: 0 auto;
    max-width: 1180px;
    padding: 34px 28px 60px;
    width: 100%;
}

.demo-badge {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 999px;
    color: #713f12;
    font-size: 13px;
    font-weight: 750;
    justify-self: end;
    padding: 6px 12px;
    white-space: nowrap;
}

.header-action {
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
}

.demo-intro {
    margin-bottom: 22px;
    max-width: 760px;
}

.demo-intro h1 {
    font-size: clamp(34px, 4.6vw, 52px);
    margin-bottom: 12px;
}

.demo-intro p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
    margin: 0;
}

/* Alerts */
.alert-strip {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.alert-strip:empty {
    display: none;
}

.alert {
    align-items: center;
    border: 1px solid;
    border-radius: 8px;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    padding: 11px 14px;
}

.alert.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert.warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.alert.info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Tabs */
.demo-tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    overflow-x: auto;
}

.tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 750;
    padding: 11px 14px;
    white-space: nowrap;
}

.tab.active {
    border-bottom-color: var(--teal);
    color: var(--ink);
}

.tab .count {
    background: #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    margin-left: 6px;
    padding: 2px 7px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.panel-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.panel-toolbar h2 {
    font-size: 24px;
    margin: 0;
}

.panel-hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 18px;
    max-width: 700px;
}

.primary-action.small {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    min-height: 38px;
    padding: 8px 14px;
}

/* Board */
.board {
    display: grid;
    gap: 12px;
    grid-auto-columns: minmax(230px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 10px;
}

.board-col {
    background: #eef1ee;
    border-radius: 10px;
    min-height: 220px;
    padding: 10px;
}

.board-col h3 {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: space-between;
    letter-spacing: 0.02em;
    margin: 2px 4px 10px;
    text-transform: uppercase;
}

.board-col h3 .count {
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    padding: 1px 8px;
}

.job-card {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 6px solid var(--blue);
    border-radius: 8px;
    cursor: pointer;
    display: block;
    font-family: inherit;
    margin-bottom: 10px;
    padding: 12px;
    text-align: left;
    width: 100%;
}

.job-card:hover {
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.10);
}

.job-card.s-waiting { border-left-color: var(--orange); }
.job-card.s-billing { border-left-color: var(--teal); }
.job-card.s-done { border-left-color: #94a3b8; }

.job-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 3px;
}

.job-card small {
    color: var(--muted);
    display: block;
    font-size: 13px;
    line-height: 1.45;
}

.job-card .money {
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 800;
    margin-top: 6px;
}

/* Tables */
.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    min-width: 560px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    padding: 11px 14px;
    text-align: left;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 750;
    padding: 3px 10px;
    white-space: nowrap;
}

.pill.unbilled { background: #fff7ed; color: #9a3412; }
.pill.billed { background: #ecfdf5; color: #065f46; }
.pill.open { background: #eff6ff; color: #1e40af; }
.pill.done { background: #ecfdf5; color: #065f46; }
.pill.overdue { background: #fef2f2; color: #991b1b; }
.pill.sent { background: #ecfdf5; color: #065f46; }
.pill.draft { background: #fef9c3; color: #713f12; }

/* Billing */
.billing-card,
.packet-card,
.task-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 16px;
}

.billing-card h3,
.packet-card h3 {
    font-size: 17px;
    margin: 0 0 6px;
}

.billing-card p,
.packet-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 10px;
}

.packet-lines {
    border-top: 1px dashed var(--line);
    margin-top: 10px;
    padding-top: 10px;
}

.packet-line {
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    padding: 3px 0;
}

.packet-line.total {
    border-top: 1px solid var(--line);
    font-weight: 800;
    margin-top: 6px;
    padding-top: 8px;
}

.empty-note {
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    padding: 22px;
    text-align: center;
}

/* Tasks */
.task-card {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.task-card .task-info strong {
    display: block;
    font-size: 15px;
}

.task-card .task-info small {
    color: var(--muted);
    font-size: 13px;
}

.task-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

/* Buttons */
.ghost-btn {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
}

.ghost-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.ghost-btn.danger:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Drawer */
.drawer-backdrop,
.modal-backdrop {
    background: rgba(17, 24, 39, 0.45);
    inset: 0;
    position: fixed;
    z-index: 40;
}

.drawer {
    background: #fff;
    border-left: 1px solid var(--line);
    bottom: 0;
    box-shadow: -18px 0 50px rgba(17, 24, 39, 0.18);
    max-width: 440px;
    overflow-y: auto;
    padding: 22px;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 50;
}

.drawer h2 {
    font-size: 22px;
    margin: 0 0 4px;
    padding-right: 40px;
}

.drawer .drawer-sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 16px;
}

.drawer-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 16px;
}

.drawer-section {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.drawer-section h3 {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.drawer-list {
    display: grid;
    gap: 8px;
}

.drawer-list .item {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    padding: 9px 11px;
}

.drawer-list .item strong {
    display: block;
    font-size: 14px;
}

/* Forms */
.field {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
}

.field label {
    font-size: 13px;
    font-weight: 750;
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    padding: 9px 11px;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    outline: 2px solid rgba(15, 118, 110, 0.18);
}

/* Modal */
.modal-backdrop {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(17, 24, 39, 0.3);
    max-height: 90vh;
    max-width: 460px;
    overflow-y: auto;
    padding: 22px;
    width: 100%;
}

.modal h2 {
    font-size: 21px;
    margin: 0 0 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

/* CTA */
.demo-cta {
    align-items: center;
    background: var(--teal-dark);
    border-radius: 14px;
    color: #fff;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto;
    margin-top: 44px;
    padding: 28px;
}

.demo-cta h2 {
    font-size: 24px;
    margin: 0 0 6px;
}

.demo-cta p {
    color: #d9fff9;
    font-size: 15px;
    margin: 0;
}

.demo-cta .primary-action {
    background: #fff;
    color: var(--teal-dark);
}

.toast {
    background: var(--ink);
    border-radius: 10px;
    bottom: 22px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    left: 50%;
    max-width: 90vw;
    opacity: 0;
    padding: 12px 18px;
    position: fixed;
    transform: translate(-50%, 8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 90;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 700px) {
    .demo-main {
        padding: 24px 16px 44px;
    }

    .demo-badge {
        display: none;
    }

    .demo-cta {
        grid-template-columns: 1fr;
    }

    .task-card {
        align-items: flex-start;
        flex-direction: column;
    }
}
