/* ── Dumë · Branding system ─────────────────────────────
   Tipografía delgada, paleta cálida y trazos suaves.
   Inspirada en el wordmark "dumë" con remates rounded.
─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600&family=Outfit:wght@200;300;400;500&display=swap');

:root {
    --bg: #f6f4ee;            /* fondo cálido, papel suave */
    --card: #ffffff;
    --text: #2d3236;          /* charcoal del wordmark */
    --muted: #8a8d8a;
    --line: #e7e3d6;          /* línea cálida */
    --line-strong: #d8d3c1;
    --accent: #2d3236;        /* charcoal */
    --accent-soft: #4a4f53;
    --accent-cream: #d6d4c8;  /* crema del logo */
    --accent-cream-2: #ebe7d8;
    --danger: #b07070;
    --success: #6b8f6b;
    --sidebar: #2d3236;
    --sidebar-soft: #373c40;
    --shadow-sm: 0 4px 14px rgba(45, 50, 54, 0.06);
    --shadow-md: 0 14px 40px rgba(45, 50, 54, 0.10);
    --shadow-lg: 0 28px 70px rgba(45, 50, 54, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-sans: 'Outfit', 'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-brand: 'Quicksand', 'Outfit', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--accent); text-decoration: none; transition: color .18s; }
a:hover { color: var(--accent-soft); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 {
    font-family: var(--font-brand);
    font-weight: 400;
    letter-spacing: -0.005em;
    color: var(--text);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
strong, b { font-weight: 500; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-family: inherit;
    font-weight: 300;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(45, 50, 54, 0.08);
}
textarea { resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
}

/* ── Guest / login ─────────────────────────────────── */
.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(214, 212, 200, 0.45), transparent 55%),
        radial-gradient(circle at 85% 80%, rgba(45, 50, 54, 0.08), transparent 60%),
        var(--bg);
    padding: 24px;
}
.guest-shell { width: min(440px, calc(100vw - 32px)); }
.login-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(45, 50, 54, 0.04);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.login-brand h1 {
    font-family: var(--font-brand);
    font-weight: 300;
    font-size: 26px;
    letter-spacing: -0.01em;
}
.login-brand p {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
}
.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--accent);
    color: var(--accent-cream);
    font-family: var(--font-brand);
    font-weight: 300;
    font-size: 22px;
    letter-spacing: -0.02em;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.brand-logo {
    max-width: 160px;
    max-height: 60px;
    object-fit: contain;
    display: block;
}
.brand-logo-login { max-width: 130px; }
.login-hint {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}
.login-hint strong {
    color: var(--text);
    font-weight: 400;
    font-size: 14px;
}

/* ── App shell ─────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.sidebar {
    width: 268px;
    background: var(--sidebar);
    color: var(--accent-cream-2);
    padding: 34px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar h1 {
    font-family: var(--font-brand);
    font-weight: 300;
    font-size: 26px;
    letter-spacing: -0.01em;
    margin-top: 18px;
    color: #f4f1e6;
}
.sidebar p, .sidebar span { color: rgba(235, 231, 216, 0.55); font-weight: 300; font-size: 13px; letter-spacing: 0.02em; }
.sidebar .brand-mark { background: var(--accent-cream); color: var(--accent); }
.sidebar-nav { display: grid; gap: 4px; margin-top: 28px; }
.sidebar-nav a {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: rgba(235, 231, 216, 0.72);
    font-weight: 300;
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: background .18s, color .18s;
    position: relative;
}
.sidebar-nav a:hover {
    background: rgba(235, 231, 216, 0.06);
    color: #f4f1e6;
}
.sidebar-nav a.is-active {
    background: rgba(214, 212, 200, 0.12);
    color: var(--accent-cream);
    font-weight: 400;
}
.sidebar-nav a.is-active::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: var(--accent-cream);
    border-radius: 2px;
}
.sidebar-user {
    display: grid;
    gap: 4px;
    font-size: 13px;
    padding: 16px;
    background: rgba(235, 231, 216, 0.05);
    border-radius: var(--radius-md);
}
.sidebar-user strong { color: #f4f1e6; font-weight: 400; font-size: 14px; }
.sidebar-user a {
    color: var(--accent-cream);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
}
.sidebar-user a:hover { color: #fff; }
.sidebar-footer-note {
    display: grid;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(235, 231, 216, 0.08);
}
.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}
.sidebar-footer-actions a,
.sidebar-footer-actions .link-button { color: var(--accent-cream); letter-spacing: 0.04em; }
.developer-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(235, 231, 216, 0.28);
    text-align: left;
    font: inherit;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .18s;
}
.developer-trigger:hover { color: rgba(235, 231, 216, 0.6); }

/* ── Content area ──────────────────────────────────── */
.content-area {
    flex: 1;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}
.page-header h2 {
    font-family: var(--font-brand);
    font-weight: 300;
    font-size: 32px;
    letter-spacing: -0.015em;
}
.page-header p { margin-top: 6px; color: var(--muted); font-weight: 300; }

.card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(45, 50, 54, 0.04);
}
.form-card { max-width: 960px; }
.stat-card { padding: 24px; }
.stat-card strong {
    font-family: var(--font-brand);
    font-size: 38px;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-top: 10px;
    display: block;
    color: var(--accent);
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.section-head h3 {
    font-family: var(--font-brand);
    font-weight: 400;
    font-size: 20px;
}
.section-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.stack-md > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 24px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 26px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.03em;
    min-height: 46px;
    transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    color: var(--accent-cream);
}
.btn-primary:hover { background: var(--accent-soft); color: #fff; }
.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--accent-cream-2); border-color: var(--accent-cream); }
.btn-block { width: 100%; }

/* ── Alerts ────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 300;
    border: 1px solid transparent;
}
.alert-success { background: #eef3ec; color: #3d5c3d; border-color: #d3e2d1; }
.alert-danger { background: #f6eaea; color: #7a4040; border-color: #e9d4d4; }
.error-list { margin: 0; padding-left: 18px; }

/* ── Tables ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 400;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color .18s;
}
.link-button:hover { border-bottom-color: var(--accent); }
.danger-link { color: var(--danger); }
.muted { color: var(--muted); font-weight: 300; }
.text-right { text-align: right; }

/* ── Info cards ────────────────────────────────────── */
.info-card {
    background: var(--accent-cream-2);
    border: 1px solid var(--accent-cream);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.info-card span, .table-note { color: var(--accent-soft); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.info-card strong {
    display: block;
    margin-top: 8px;
    font-family: var(--font-brand);
    font-weight: 300;
    font-size: 26px;
    letter-spacing: -0.01em;
    color: var(--accent);
}
.detail-grid { font-size: 15px; font-weight: 300; }

/* ── Quotation form ────────────────────────────────── */
.quotation-form { max-width: 1160px; }
.item-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: #fbfaf5;
}
.item-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.item-badge {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.badge-product { background: var(--accent-cream-2); color: var(--accent); }
.badge-custom { background: rgba(45, 50, 54, 0.06); color: var(--accent-soft); }
.is-hidden { display: none; }

.totals-panel {
    margin-left: auto;
    width: min(380px, 100%);
    border-radius: var(--radius-lg);
    background: var(--accent-cream-2);
    padding: 22px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--accent-cream);
}
.totals-panel div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 300;
}
.totals-panel strong {
    font-family: var(--font-brand);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--accent);
}

.actions-row { display: flex; flex-wrap: wrap; gap: 12px; }
.align-end-row { align-items: end; }
.page-actions { justify-content: flex-end; }
.status-field { min-width: min(260px, 100%); }
.guest-footer-note {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 300;
}

/* ── Brand assets ──────────────────────────────────── */
.brand-assets-grid { align-items: stretch; }
.brand-asset-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: #fbfaf5;
}
.brand-preview-image {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid var(--line);
    padding: 12px;
}
.brand-preview-qr { max-width: 140px; }
.brand-preview-placeholder {
    min-height: 110px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--muted);
    background: #fff;
    font-size: 13px;
    letter-spacing: 0.04em;
}

/* ── PIN modal ─────────────────────────────────────── */
.pin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
}
.pin-modal[hidden] { display: none !important; }
.pin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 50, 54, 0.42);
    backdrop-filter: blur(4px);
}
.pin-modal-card {
    position: relative;
    width: min(460px, calc(100vw - 32px));
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

/* ── Mobile top bar ────────────────────────────────── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 150;
    height: 60px;
    background: var(--sidebar);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}
.mobile-brand-logo {
    max-width: 110px;
    max-height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}
.mobile-topbar .brand-mark {
    width: 38px; height: 38px;
    font-size: 15px;
    border-radius: 12px;
    flex-shrink: 0;
    background: var(--accent-cream);
    color: var(--accent);
}
.mobile-topbar-name {
    color: var(--accent-cream);
    font-family: var(--font-brand);
    font-size: 17px;
    font-weight: 300;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(235, 231, 216, 0.08);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--accent-cream);
    border-radius: 2px;
    transition: transform 0.22s, opacity 0.22s;
}
body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(45, 50, 54, 0.42);
    backdrop-filter: blur(2px);
}
body.nav-open .nav-overlay { display: block; }

.nav-close-btn { display: none; }
.nav-close-btn button {
    width: 36px; height: 36px;
    border: 0;
    background: rgba(235, 231, 216, 0.08);
    border-radius: 10px;
    color: var(--accent-cream);
    font-size: 22px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
}
.nav-close-btn button:hover { background: rgba(235, 231, 216, 0.18); }

/* ── Responsive: tablet / large mobile ─────────────── */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-area { padding: 32px 28px; }
}

/* ── Responsive: mobile ─────────────────────────────── */
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: min(300px, 85vw);
        height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 160;
        align-self: auto;
    }
    body.nav-open .sidebar { transform: translateX(0); }

    .nav-close-btn {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 6px;
    }

    .content-area { padding: 80px 18px 36px; gap: 18px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .section-head .actions-row { width: 100%; }
    .section-head .actions-row .btn { flex: 1; justify-content: center; }

    .page-actions { justify-content: stretch; }
    .page-actions .btn { width: 100%; justify-content: center; }

    .btn { min-height: 48px; font-size: 15px; }

    input, select, textarea { font-size: 16px; }

    .totals-panel { width: 100%; margin-left: 0; }

    .status-field { min-width: 100%; }
    .align-end-row { flex-direction: column; align-items: stretch; }
    .align-end-row .btn { width: 100%; }

    .info-card strong { font-size: 20px; }

    .page-header h2 { font-size: 26px; }
    .page-header p { display: none; }

    th, td { padding: 12px 14px; }
    .table-actions { gap: 10px; }
}

/* ── Responsive: small phones ───────────────────────── */
@media (max-width: 480px) {
    .card { padding: 20px; border-radius: var(--radius-lg); }
    .item-card { padding: 16px; border-radius: var(--radius-md); }

    .stat-card { display: flex; align-items: center; justify-content: space-between; }
    .stat-card strong { font-size: 30px; margin-top: 0; }
}
