/* Ruta completa del archivo: C:\Users\Jorge\Documents\PROYECTO CAFE\cafemanager\assets\css\main.css */
:root {
    --bg: #f2efe8;
    --panel: #ffffff;
    --ink: #2e241c;
    --muted: #6f6258;
    --primary: #2f6d46;
    --primary-dark: #1c4a2f;
    --accent: #c78b32;
    --danger: #b54231;
    --border: #ded4c7;
    --shadow: 0 18px 45px rgba(47, 32, 15, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(199, 139, 50, 0.12), transparent 22%),
        linear-gradient(180deg, #f8f5ee 0%, #efe8de 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(300px, 330px) 1fr;
    min-height: 100vh;
}

.sidebar {
    background:
        radial-gradient(circle at top left, rgba(199, 139, 50, 0.24), transparent 32%),
        linear-gradient(180deg, #30271f 0%, #1d1712 58%, #14100d 100%);
    color: #f7efe2;
    padding: 1.15rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.brand h2,
.brand p {
    margin: 0;
}

.brand h2 {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand p {
    margin-top: 0.15rem;
    color: rgba(247, 239, 226, 0.68);
    font-size: 0.85rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 18px;
    color: #24180e;
    font-weight: 800;
    background:
        linear-gradient(135deg, #f4d39a, #c78b32 65%, #8f5f20);
    box-shadow: 0 10px 22px rgba(199, 139, 50, 0.2);
}

.sidebar-search {
    display: grid;
    gap: 0.4rem;
    padding: 0 0.15rem;
}

.sidebar-search span {
    color: rgba(247, 239, 226, 0.7);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-search input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.78rem 1rem;
    color: #fff9ee;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-search input::placeholder {
    color: rgba(247, 239, 226, 0.44);
}

.sidebar-search input:focus {
    border-color: rgba(199, 139, 50, 0.85);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(199, 139, 50, 0.13);
}

.sidebar-nav {
    display: grid;
    gap: 0.75rem;
    align-content: start;
    overflow-y: auto;
    padding: 0.1rem 0.2rem 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 139, 50, 0.55) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(199, 139, 50, 0.5);
}

.nav-group {
    display: grid;
    gap: 0.45rem;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0.6rem 0.7rem 0.6rem 0.95rem;
    cursor: pointer;
    color: rgba(247, 239, 226, 0.78);
    background: rgba(255, 255, 255, 0.045);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-group-toggle:hover {
    color: #fff9ee;
    background: rgba(255, 255, 255, 0.095);
    box-shadow: inset 0 0 0 1px rgba(199, 139, 50, 0.18);
}

.nav-group-toggle strong {
    display: inline-grid;
    place-items: center;
    min-width: 2.15rem;
    height: 1.45rem;
    border-radius: 999px;
    color: #f7efe2;
    background: rgba(199, 139, 50, 0.24);
    font-size: 0.75rem;
}

.nav-group-items {
    display: none;
    gap: 0.48rem;
    padding-left: 0.25rem;
}

.nav-group-items.is-open {
    display: grid;
    animation: menuReveal 0.16s ease-out;
}

.nav-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.25rem;
    padding: 0.55rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.095);
    border-radius: 999px;
    color: rgba(255, 249, 238, 0.86);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.nav-card::after {
    content: "";
    position: absolute;
    inset: 0.36rem auto 0.36rem 0.38rem;
    width: 0.22rem;
    border-radius: 999px;
    background: #c78b32;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.nav-card:hover,
.nav-card.is-active {
    transform: translateX(4px);
    border-color: rgba(199, 139, 50, 0.42);
    background:
        linear-gradient(90deg, rgba(199, 139, 50, 0.18), rgba(255, 255, 255, 0.08));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.nav-card:hover::after,
.nav-card.is-active::after {
    opacity: 1;
}

.nav-card.is-active {
    color: #fff;
    background:
        linear-gradient(90deg, rgba(47, 109, 70, 0.86), rgba(199, 139, 50, 0.24)),
        rgba(255, 255, 255, 0.08);
}

.nav-icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-width: 2.35rem;
    height: 1.65rem;
    padding: 0 0.55rem;
    border: 1px solid rgba(199, 139, 50, 0.28);
    border-radius: 999px;
    color: #f5d79a;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    background: rgba(199, 139, 50, 0.12);
}

.nav-card.is-active .nav-icon {
    color: #fff6df;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
}

.nav-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.nav-copy strong {
    overflow: hidden;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-copy small {
    color: rgba(247, 239, 226, 0.56);
    font-size: 0.76rem;
}

.nav-card.is-hidden,
.nav-group.is-hidden {
    display: none;
}

@keyframes menuReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    min-width: 0;
    padding: 1.5rem 2rem 2.5rem;
}

.sidebar-mobile-toggle {
    display: none;
}

.topbar,
.panel-header,
.toolbar,
.form-actions,
.stats-grid,
.cards-grid,
.timeline {
    display: flex;
    gap: 1rem;
}

.topbar,
.panel-header,
.toolbar {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    background: #fff;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-small {
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
}

.flash {
    border-radius: 16px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.flash-success {
    background: rgba(47, 109, 70, 0.12);
    border: 1px solid rgba(47, 109, 70, 0.2);
}

.flash-error {
    background: rgba(181, 66, 49, 0.12);
    border: 1px solid rgba(181, 66, 49, 0.2);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    background: #fffefb;
}

.field textarea {
    resize: vertical;
}

.error {
    color: var(--danger);
}

.stats-grid,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card,
.module-card,
.timeline-item,
.checklist-group {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 243, 235, 0.96));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
    background: rgba(47, 109, 70, 0.12);
}

.status-red {
    background: rgba(181, 66, 49, 0.12);
}

.status-yellow {
    background: rgba(199, 139, 50, 0.16);
}

.status-green {
    background: rgba(47, 109, 70, 0.12);
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 1rem;
}

.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));
}

.signature-pad {
    width: 100%;
    min-height: 180px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: #fff;
}

.report-summary-grid {
    margin: 1.5rem 0;
}

.report-hub-grid,
.report-stack {
    margin-top: 1.5rem;
}

.report-link-card {
    display: grid;
    gap: 0.9rem;
    align-content: start;
}

.report-link-card strong {
    font-size: 1.3rem;
}

.report-link-card p {
    margin: 0;
    color: var(--muted);
}

.toolbar select {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    background: #fff;
}

.report-summary-card strong {
    display: block;
    font-size: 1.7rem;
    margin: 0.85rem 0 0.35rem;
}

.report-summary-card p,
.report-chart-card p {
    margin: 0;
    color: var(--muted);
}

.report-chart-grid {
    align-items: stretch;
}

.report-chart-card {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.chart-shell {
    min-width: 0;
    position: relative;
    min-height: 280px;
}

.report-empty {
    min-height: 280px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(248, 243, 235, 0.7);
}

.panel-section {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.catacion-form {
    display: grid;
    gap: 1.25rem;
}

.catacion-repeatable {
    display: grid;
    gap: 0.85rem;
}

.catacion-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 0.85rem;
}

.catacion-leader-field input {
    width: auto;
    justify-self: start;
}

.catacion-score-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.catacion-clock-card {
    align-content: center;
}

.catacion-clock-card strong,
.catacion-clock {
    display: block;
    font-size: clamp(2rem, 7vw, 4.5rem);
    line-height: 1;
    margin: 0.6rem 0;
}

.catacion-phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    align-items: end;
}

.catacion-panel .module-card strong {
    display: block;
    margin: 0.45rem 0;
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        height: auto;
        max-height: none;
        overflow: visible;
        display: block;
        padding: 0.75rem;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 16px 32px rgba(25, 16, 10, 0.22);
    }

    .brand {
        display: grid;
        grid-template-columns: auto 1fr auto;
        padding: 0.55rem;
        border-radius: 18px;
    }

    .brand-mark {
        width: 2.45rem;
        height: 2.45rem;
        border-radius: 14px;
        font-size: 0.82rem;
    }

    .brand h2 {
        font-size: 0.98rem;
    }

    .brand p {
        font-size: 0.76rem;
    }

    .sidebar-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(199, 139, 50, 0.32);
        border-radius: 999px;
        padding: 0.58rem 0.9rem;
        color: #fff6df;
        background: rgba(199, 139, 50, 0.18);
        font: inherit;
        font-size: 0.82rem;
        font-weight: 800;
        cursor: pointer;
    }

    .sidebar-mobile-toggle[aria-expanded="true"] {
        color: #2e241c;
        background: #f4d39a;
    }

    .sidebar-search,
    .sidebar-nav {
        display: none;
    }

    .sidebar.is-mobile-open .sidebar-search {
        display: grid;
        margin-top: 0.85rem;
    }

    .sidebar.is-mobile-open .sidebar-nav {
        display: grid;
        margin-top: 0.85rem;
        max-height: min(64vh, 520px);
        overflow-y: auto;
    }

    .sidebar-nav {
        padding-right: 0.1rem;
    }

    .content {
        padding: 1rem;
        width: 100%;
    }

    .form-grid,
    .catacion-row,
    .catacion-score-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        border: 1px solid var(--border);
        border-radius: 16px;
        margin-bottom: 1rem;
        background: #fff;
    }
}
