:root {
    --ink: #17324d;
    --muted: #6b7785;
    --line: #e2e7ec;
    --bg: #f4f6f8;
    --green: #668f10;
    --green2: #567a0d;
    --red: #b42318
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg)
}

a {
    text-decoration: none;
    color: inherit
}

button,
input,
select,
textarea {
    font: inherit
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    background: #10283d;
    color: #fff
}

.admin-brand {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 34px
}

.admin-brand small {
    display: block;
    color: #aab8c5;
    font-size: .72rem;
    font-weight: 400
}

.admin-menu {
    display: grid;
    gap: 5px
}

.admin-menu a {
    padding: 12px 14px;
    border-radius: 9px
}

.admin-menu a:hover {
    background: #ffffff14
}

.admin-user {
    margin-top: auto;
    display: grid;
    gap: 5px
}

.admin-user small {
    color: #aab8c5
}

.admin-logout {
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid #476076;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer
}

.admin-main {
    min-width: 0;
    padding: 36px
}

.admin-page-head {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px
}

.admin-page-head h1 {
    margin: 0;
    font-size: 2rem
}

.admin-page-head p {
    margin: 6px 0 0;
    color: var(--muted)
}

.admin-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-weight: 700;
    cursor: pointer
}

.admin-btn-primary {
    border-color: var(--green);
    background: var(--green);
    color: #fff
}

.admin-btn-primary:hover {
    background: var(--green2)
}

.admin-btn-danger {
    border-color: #efc3bf;
    color: var(--red)
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px
}

.admin-card,
.admin-box {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff
}

.admin-card small {
    display: block;
    margin-bottom: 9px;
    color: var(--muted)
}

.admin-card strong {
    font-size: 1.8rem
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff
}

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

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap
}

.admin-table th {
    background: #f7f9fa;
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase
}

.admin-actions {
    display: flex;
    gap: 7px
}

.admin-form {
    max-width: 800px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff
}

.admin-field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px
}

.admin-field label {
    font-weight: 700
}

.admin-field input,
.admin-field select,
.admin-field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cdd5dc;
    border-radius: 8px
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px
}

.admin-image-preview {
    width: 180px;
    max-height: 180px;
    object-fit: contain;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafb
}

.admin-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 20px;
    background: #eef2f4;
    font-size: .76rem;
    font-weight: 700
}

.admin-badge-success {
    background: #eaf5d9;
    color: #456a08
}

.admin-alert {
    margin-bottom: 22px;
    padding: 14px 17px;
    border-radius: 9px
}

.admin-alert-success {
    background: #eaf5d9;
    color: #456a08
}

.admin-alert-error {
    background: #fff0ef;
    color: #9e2117
}

.admin-order-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px
}

.admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px
}

.admin-login-box {
    width: min(420px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff
}

@media(max-width:900px) {
    .admin-layout {
        grid-template-columns: 1fr
    }

    .admin-sidebar {
        position: static;
        height: auto
    }

    .admin-user {
        margin-top: 25px
    }

    .admin-cards {
        grid-template-columns: repeat(2, 1fr)
    }

    .admin-order-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:560px) {
    .admin-main {
        padding: 20px
    }

    .admin-page-head {
        align-items: flex-start;
        flex-direction: column
    }

    .admin-cards,
    .admin-grid-2 {
        grid-template-columns: 1fr
    }
}

/* =========================================================
   LOGIN ADMIN
   ========================================================= */

.admin-login-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(248, 173, 27, .08),
            transparent 32%
        ),
        linear-gradient(
            145deg,
            #f8fafc 0%,
            #f1f5f9 100%
        );
    color: #0b1f3a;
}

.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.admin-login-box {
    width: 100%;
    max-width: 430px;
    padding: 38px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    box-shadow:
        0 25px 70px rgba(15, 23, 42, .10),
        0 5px 20px rgba(15, 23, 42, .04);
}

.admin-login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.admin-login-logo {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    color: #5f8f00;
    background: #f4f8e8;
    border: 1px solid #e4edca;
    border-radius: 14px;
}

.admin-login-logo svg {
    width: 26px;
    height: 26px;
}

.admin-login-kicker {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.admin-login-box h1 {
    margin: 0;
    color: #0b1f3a;
    font-size: 2rem;
    line-height: 1.1;
}

.admin-login-description {
    margin: 0 0 28px;
    color: #64748b;
    font-size: .95rem;
    line-height: 1.55;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-login-box .admin-field {
    margin: 0;
}

.admin-login-box .admin-field label {
    display: block;
    margin-bottom: 8px;
    color: #162b46;
    font-size: .88rem;
    font-weight: 700;
}

.admin-input-wrap {
    position: relative;
}

.admin-input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.admin-input-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.admin-login-box input {
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 15px 0 46px;
    color: #0f172a;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    font-size: .95rem;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.admin-login-box input::placeholder {
    color: #a8b1bf;
}

.admin-login-box input:hover {
    border-color: #94a3b8;
}

.admin-login-box input:focus {
    border-color: #6a9805;
    box-shadow:
        0 0 0 4px rgba(106, 152, 5, .12);
}

.admin-login-submit {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    border: 0;
    border-radius: 11px;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.admin-login-submit svg {
    width: 19px;
    height: 19px;
}

.admin-login-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(95, 143, 0, .22);
}

.admin-login-submit:active {
    transform: translateY(0);
}

.admin-login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #edf0f3;
    color: #64748b;
    font-size: .78rem;
}

.admin-login-footer a {
    color: #45566c;
    font-weight: 700;
    text-decoration: none;
}

.admin-login-footer a:hover {
    color: #0b1f3a;
    text-decoration: underline;
}

.admin-login-security {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-login-security svg {
    width: 17px;
    height: 17px;
    color: #6a9805;
}

.admin-login-box .admin-alert {
    margin-bottom: 22px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .86rem;
    line-height: 1.4;
}

.admin-login-box .admin-alert-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

@media (max-width: 520px) {

    .admin-login-wrapper {
        padding: 20px 14px;
    }

    .admin-login-box {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .admin-login-box h1 {
        font-size: 1.75rem;
    }

    .admin-login-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-page {
    width: 100%;
}

.dashboard-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.admin-page-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #6a9805;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.dashboard-heading h1,
.dashboard-panel-head h2 {
    margin: 0;
    color: #0b1f3a;
}

.dashboard-heading h1 {
    font-size: 2.15rem;
    line-height: 1.1;
}

.dashboard-heading p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: .96rem;
}

.dashboard-date {
    min-width: 125px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: right;
}

.dashboard-date span {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-date strong {
    color: #334155;
    font-size: .88rem;
}


/* =========================================================
   TARJETAS KPI
   ========================================================= */

.dashboard-stats {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 38px;
}

.dashboard-stat-card {
    position: relative;
    min-height: 155px;
    padding: 22px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow:
        0 8px 24px rgba(15, 23, 42, .035);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    border-color: #d7dfc6;
    box-shadow:
        0 14px 32px rgba(15, 23, 42, .07);
}

.dashboard-stat-top {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 19px;
}

.dashboard-stat-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    color: #639000;
    background: #f4f8e8;
    border-radius: 11px;
}

.dashboard-stat-icon svg {
    width: 21px;
    height: 21px;
}

.dashboard-stat-label {
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
}

.dashboard-stat-value {
    display: block;
    margin-bottom: 8px;
    color: #0b1f3a;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -.02em;
}

.dashboard-stat-note {
    display: block;
    color: #94a3b8;
    font-size: .75rem;
    line-height: 1.4;
}


/* =========================================================
   PANEL
   ========================================================= */

.dashboard-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow:
        0 8px 26px rgba(15, 23, 42, .035);
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    border-bottom: 1px solid #edf1f5;
}

.dashboard-panel-head h2 {
    font-size: 1.35rem;
}

.dashboard-panel-head p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: .84rem;
}

.dashboard-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #587f00;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-panel-link svg {
    width: 17px;
    height: 17px;
    transition: transform .2s ease;
}

.dashboard-panel-link:hover svg {
    transform: translateX(3px);
}


/* =========================================================
   TABLA
   ========================================================= */

.dashboard-table-wrap {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

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

.dashboard-table thead {
    background: #f8fafc;
}

.dashboard-table th {
    padding: 14px 18px;
    color: #64748b;
    border-bottom: 1px solid #e7ebef;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.dashboard-table td {
    padding: 16px 18px;
    color: #475569;
    border-bottom: 1px solid #edf1f5;
    font-size: .84rem;
    vertical-align: middle;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table tbody tr {
    transition: background .16s ease;
}

.dashboard-table tbody tr:hover {
    background: #fafcf7;
}

.dashboard-order-number {
    color: #0b1f3a;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 9px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-table-action {
    text-align: right !important;
}

.dashboard-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 13px;
    color: #426800;
    background: #f4f8e8;
    border: 1px solid #e2ebca;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 800;
    text-decoration: none;
    transition:
        background .18s ease,
        border-color .18s ease;
}

.dashboard-view-btn:hover {
    background: #eaf2d5;
    border-color: #d4e2af;
}


/* =========================================================
   SIN PEDIDOS
   ========================================================= */

.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 35px 20px;
    text-align: center;
}

.dashboard-empty-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #6a9805;
    background: #f4f8e8;
    border-radius: 15px;
}

.dashboard-empty-icon svg {
    width: 27px;
    height: 27px;
}

.dashboard-empty strong {
    color: #0b1f3a;
    font-size: .95rem;
}

.dashboard-empty p {
    max-width: 360px;
    margin: 7px 0 0;
    color: #94a3b8;
    font-size: .82rem;
    line-height: 1.5;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .dashboard-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .dashboard-heading {
        flex-direction: column;
    }

    .dashboard-date {
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-table-wrap {
        overflow-x: auto;
    }

    .dashboard-table {
        min-width: 850px;
    }
}