/* Atelier Orders — warm boutique design system */

:root {
    --bg: #faf5ee;
    --surface: #ffffff;
    --surface-2: #fdf8f1;
    --border: #e9ddcc;
    --text: #3d2b25;
    --text-dim: #9a8574;
    --accent: #8b2942;
    --accent-dim: #f3e0e4;
    --gold: #b8912f;
    --gold-dim: #f4ecd8;
    --ok: #5f7a52;
    --ok-dim: #e7edde;
    --warn: #b8912f;
    --danger: #a13d3d;
    --danger-dim: #f6e3e0;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 18px rgba(61, 43, 37, 0.06);
    --shadow-lift: 0 10px 30px rgba(61, 43, 37, 0.12);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Lato', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--text);
    font-weight: 700;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---------- Layout: sidebar retained, restyled ---------- */

.atelier-shell {
    display: flex;
    min-height: 100vh;
}

.atelier-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 28px 0;
    display: flex;
    flex-direction: column;
}

.atelier-brand {
    padding: 0 26px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.atelier-brand .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
}

.atelier-brand h1 {
    font-size: 20px;
    margin: 0;
    letter-spacing: 0.3px;
}

.atelier-brand span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.atelier-nav {
    flex: 1;
    padding: 0 14px;
}

.atelier-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.atelier-nav a i { width: 18px; text-align: center; color: var(--gold); }

.atelier-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.atelier-nav a.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-left-color: var(--accent);
}

.atelier-nav a.active i { color: var(--accent); }

.atelier-user {
    padding: 16px 26px 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.atelier-user .u-name { font-weight: 700; font-size: 14px; }
.atelier-user .u-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.atelier-user a.logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 8px;
    font-weight: 600;
}

.atelier-main {
    flex: 1;
    padding: 30px 40px 60px;
    max-width: 1180px;
}

.atelier-topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 10px;
}

.atelier-topbar h2 { font-size: 26px; margin: 0; }
.atelier-topbar p { color: var(--text-dim); margin: 4px 0 0; font-size: 13.5px; }

.atelier-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text);
}

/* ---------- Stat cards ---------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--gold);
}

.stat-card.accent-plum::before { background: var(--accent); }
.stat-card.accent-sage::before { background: var(--ok); }
.stat-card.accent-rust::before { background: var(--danger); }

.stat-card .stat-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 700;
}

.stat-card .stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

/* ---------- Panels & cards ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.panel-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-head h3 { font-size: 17px; margin: 0; }
.panel-body { padding: 22px 24px; }
.panel-body.p-0 { padding: 0; }

/* ---------- Table ---------- */

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

.atelier-table thead th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 700;
    padding: 12px 24px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.atelier-table tbody td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.atelier-table tbody tr:last-child td { border-bottom: none; }
.atelier-table tbody tr:hover { background: var(--surface-2); }

/* ---------- Tags (status pills) ---------- */

.stitch-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stitch-tag::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.stitch-tag-thread   { background: var(--gold-dim);    color: var(--gold); }
.stitch-tag-pin      { background: var(--accent-dim);  color: var(--accent); }
.stitch-tag-needle   { background: #e6e9f6;            color: #4a4f9e; }
.stitch-tag-ready    { background: var(--ok-dim);      color: var(--ok); }
.stitch-tag-delivered{ background: var(--danger-dim);  color: var(--danger); }

/* ---------- Buttons ---------- */

.btn-atelier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-atelier:hover { background: #6f2035; color: #fff; }

.btn-atelier-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    padding: 9.5px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.btn-atelier-outline:hover { background: var(--accent-dim); color: var(--accent); }

.btn-atelier-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }

.btn-atelier-gold {
    background: var(--gold);
}
.btn-atelier-gold:hover { background: #9a7822; }

.btn-icon-atelier {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-icon-atelier:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-dim); }

/* ---------- Forms ---------- */

.form-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    background: var(--surface-2);
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: #fff;
}

/* ---------- Measurement grid ---------- */

.measure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.measure-grid .form-label { font-size: 11px; text-transform: uppercase; }

/* ---------- Auth pages ---------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f7ede1 0%, #faf5ee 60%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    overflow: hidden;
    border: 1px solid var(--border);
}

.auth-card-top {
    text-align: center;
    padding: 36px 30px 24px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.auth-logo {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 14px;
}

.auth-card-top h1 { font-size: 22px; margin: 0; }
.auth-card-top p { color: var(--text-dim); font-size: 13px; margin: 4px 0 0; }
.auth-card-body { padding: 28px 30px 32px; }

/* ---------- Misc ---------- */

.fs-13 { font-size: 13px; }
.text-dim { color: var(--text-dim); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty-state i { font-size: 32px; color: var(--border); margin-bottom: 12px; }

@media (max-width: 900px) {
    .atelier-sidebar {
        position: fixed;
        left: -260px;
        top: 0; bottom: 0;
        z-index: 1000;
        transition: left 0.2s ease;
    }
    .atelier-sidebar.open { left: 0; box-shadow: var(--shadow-lift); }
    .atelier-nav-toggle { display: inline-flex; }
    .atelier-main { padding: 20px 18px 50px; }
}
