/* Aligne POS — dark brown & gold, responsive, no JS dependencies */

:root {
    --brown-deep: #1a0f0a;
    --brown-mid: #2d1c14;
    --brown-soft: #3d2920;
    --brown-highlight: #5c4033;
    --gold: #c9a227;
    --gold-bright: #e8c547;
    --gold-dim: #8a7020;
    --cream: #f5ebe0;
    --cream-muted: #c9bfb5;
    --danger: #c94c4c;
    --success: #6b9e6b;
    --radius: 10px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    font-family: "Georgia", "Times New Roman", serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at top, var(--brown-soft) 0%, var(--brown-deep) 55%);
    color: var(--cream);
    line-height: 1.5;
}

.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;
}

/* Header */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, var(--brown-mid) 0%, var(--brown-deep) 100%);
    border-bottom: 2px solid var(--gold-dim);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--gold-bright), var(--gold));
    color: var(--brown-deep);
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(232, 197, 71, 0.35);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--cream);
}

.brand-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.nav-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    color: var(--gold-bright);
    font-size: 1.25rem;
    background: var(--brown-soft);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.site-nav a {
    color: var(--cream-muted);
    text-decoration: none;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
}

.site-nav a:hover {
    color: var(--gold-bright);
    background: rgba(201, 162, 39, 0.12);
}

.nav-user {
    color: var(--gold);
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: block;
        order: 2;
        margin-left: auto;
    }

    .brand {
        order: 1;
    }

    .site-nav {
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease;
    }

    .nav-checkbox:checked ~ .site-nav {
        max-height: 480px;
        opacity: 1;
        padding-top: 0.5rem;
        border-top: 1px solid var(--brown-highlight);
    }
}

/* Layout */
.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.site-footer {
    text-align: center;
    padding: 1rem;
    color: var(--cream-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--brown-highlight);
    background: var(--brown-deep);
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--gold-bright);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--gold);
}

p.lead {
    color: var(--cream-muted);
    margin-top: 0;
}

/* Cards & panels */
.panel {
    background: linear-gradient(180deg, rgba(61, 41, 32, 0.95), rgba(26, 15, 10, 0.92));
    border: 1px solid var(--brown-highlight);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.panel-narrow {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Flash */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid;
}

.flash-error {
    background: rgba(201, 76, 76, 0.15);
    border-color: var(--danger);
    color: #ffb3b3;
}

.flash-success {
    background: rgba(107, 158, 107, 0.15);
    border-color: var(--success);
    color: #cde8cd;
}

/* Forms */
label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--cream-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--brown-highlight);
    background: var(--brown-deep);
    color: var(--cream);
    font: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.field-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.field-inline label {
    flex: 1 1 140px;
}

.field-inline input,
.field-inline select {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--gold-dim);
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--brown-deep);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    line-height: 1.25;
}

.btn:hover {
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold);
}

.btn-ghost {
    background: transparent;
    color: var(--cream-muted);
    border-color: var(--brown-highlight);
    font-weight: 600;
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: #ffb3b3;
}

.btn-small {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--brown-highlight);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.data th,
table.data td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--brown-highlight);
}

table.data th {
    background: rgba(201, 162, 39, 0.12);
    color: var(--gold-bright);
    font-weight: 700;
}

table.data tr:last-child td {
    border-bottom: none;
}

table.data tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Stats grid */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(61, 41, 32, 0.85);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.stat-card strong {
    display: block;
    font-size: 1.6rem;
    color: var(--gold-bright);
    font-variant-numeric: tabular-nums;
}

.stat-card span {
    color: var(--cream-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Dashboard tiles */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tile {
    display: block;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--brown-soft), var(--brown-mid));
    border: 1px solid var(--gold-dim);
    color: var(--cream);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.15s;
}

.tile:hover {
    border-color: var(--gold-bright);
    transform: translateY(-2px);
}

.tile h3 {
    margin: 0 0 0.35rem;
    color: var(--gold-bright);
    font-size: 1.1rem;
}

.tile p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cream-muted);
}

/* POS layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .pos-layout {
        grid-template-columns: 1fr 340px;
        align-items: start;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}

.pos-search {
    margin-bottom: 0.95rem;
    max-width: 520px;
    position: relative;
}

.pos-search input[type="search"] {
    margin: 0;
    border: 1px solid #d9e1ec;
    background: #ffffff;
    color: #0a0a0a;
    box-shadow: none;
    border-radius: 12px;
    padding: 0.66rem 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
}

.pos-search input[type="search"]::placeholder {
    color: #7a8798;
}

.pos-search input[type="search"]:focus {
    border-color: #9db5d9;
    box-shadow: 0 0 0 2px rgba(157, 181, 217, 0.25);
    outline: none;
}

.pos-search input[type="search"]::-webkit-search-decoration,
.pos-search input[type="search"]::-webkit-search-cancel-button,
.pos-search input[type="search"]::-webkit-search-results-button,
.pos-search input[type="search"]::-webkit-search-results-decoration {
    appearance: none;
}

.product-card {
    background: var(--brown-mid);
    border: 1px solid var(--brown-highlight);
    border-radius: var(--radius);
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: var(--brown-deep);
}

.product-card .name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cream);
}

.product-card .meta {
    font-size: 0.8rem;
    color: var(--cream-muted);
}

.product-card .price {
    color: var(--gold-bright);
    font-weight: 700;
}

.product-card form {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.product-card input[type="number"] {
    margin-bottom: 0;
}

.cart-sticky {
    position: sticky;
    top: 5.5rem;
}

/* Login */
.login-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-hero .brand-mark {
    margin: 0 auto 0.75rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
}

.muted {
    color: var(--cream-muted);
    font-size: 0.9rem;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--brown-deep);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--cream-muted);
    border: 1px dashed var(--brown-highlight);
    border-radius: var(--radius);
}
