:root {
    --admin-bg: #0f172a;
    --admin-surface: #111827;
    --admin-surface-2: #1f2937;
    --admin-border: rgba(148, 163, 184, 0.14);
    --admin-card: rgba(255, 255, 255, 0.96);
    --admin-text: #e5e7eb;
    --admin-text-soft: #94a3b8;
    --admin-primary: #7c2434;
    --admin-primary-2: #f97316;
    --admin-content: #f8fafc;
    --admin-shadow: 0 25px 50px rgba(15, 23, 42, 0.18);
    --admin-radius: 24px;
}

body.admin-body,
body.auth-page {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 36, 52, 0.25), transparent 22%),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.14), transparent 22%),
        linear-gradient(135deg, #0f172a 0%, #111827 42%, #1e293b 100%);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.5rem;
    color: var(--admin-text);
    background: rgba(15, 23, 42, 0.88);
    border-right: 1px solid var(--admin-border);
    backdrop-filter: blur(14px);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.admin-brand-badge {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-2));
    box-shadow: 0 18px 40px rgba(124, 36, 52, 0.35);
    color: #fff;
    font-size: 1.3rem;
}

.admin-brand small,
.admin-sidebar-note,
.admin-user-role {
    color: var(--admin-text-soft);
}

.admin-user {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    padding: 1rem;
    margin-bottom: 1.35rem;
}

.admin-user strong {
    display: block;
    color: #fff;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--admin-text-soft);
    padding: 0.92rem 1rem;
    border-radius: 18px;
    transition: all .2s ease;
    border: 1px solid transparent;
}

.admin-link:hover,
.admin-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124, 36, 52, 0.9), rgba(249, 115, 22, 0.86));
    border-color: rgba(255,255,255,0.08);
    transform: translateX(2px);
}

.admin-link.text-danger {
    color: #fca5a5 !important;
    background: rgba(127, 29, 29, 0.12);
}

.admin-main {
    min-width: 0;
    padding: 1.5rem;
    background: var(--admin-content);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 26px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--admin-shadow);
}

.admin-topbar h1 {
    font-size: 1.15rem;
    margin: 0;
    font-weight: 800;
    color: #0f172a;
}

.admin-topbar p {
    margin: 0;
    color: #64748b;
}

.admin-topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.admin-content {
    background: transparent;
}

.alert-merlot,
.auth-alert {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.btn-outline-merlot {
    border-radius: 999px;
    padding: 0.78rem 1.15rem;
    border: 1px solid rgba(124, 36, 52, 0.2);
    color: var(--admin-primary);
    font-weight: 700;
    background: #fff;
}

.btn-outline-merlot:hover {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-2));
    color: #fff;
    border-color: transparent;
}

.btn-gold {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-2));
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.4rem;
    font-weight: 800;
    box-shadow: 0 18px 35px rgba(124, 36, 52, 0.22);
}

.btn-gold:hover {
    color: #fff;
    opacity: 0.96;
}

.mini-stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff7f4 100%);
    border-radius: 24px;
    padding: 1.25rem;
    border: 1px solid rgba(124, 36, 52, 0.08);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
    height: 100%;
}

.mini-stat-card span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
}

.mini-stat-card strong {
    display: block;
    font-size: 2rem;
    color: #0f172a;
    line-height: 1.1;
}

.mini-stat-card p {
    margin: 0.4rem 0 0;
    color: #94a3b8;
}

.card,
.login-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 28px !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.table > :not(caption) > * > * {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.form-control,
.form-select,
textarea {
    border-radius: 18px !important;
    border-color: #dbe4ee;
    min-height: 52px;
}

textarea.form-control {
    min-height: 120px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(124, 36, 52, 0.42);
    box-shadow: 0 0 0 0.25rem rgba(124, 36, 52, 0.12);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
}

.auth-logo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
    padding: 0.35rem;
}

.login-card {
    max-width: 760px;
    background: rgba(255,255,255,0.96);
    padding: 2.5rem;
}

.login-tip {
    display: inline-block;
    background: rgba(124, 36, 52, 0.08);
    color: #7c2434;
    border: 1px solid rgba(124, 36, 52, 0.12);
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

@media (max-width: 991px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

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

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


.admin-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .8rem;
    border-radius: 999px;
    background: rgba(124, 36, 52, 0.08);
    color: var(--admin-primary);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.admin-hero {
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 26%),
        radial-gradient(circle at bottom left, rgba(124, 36, 52, 0.18), transparent 24%),
        linear-gradient(135deg, #ffffff 0%, #fff7f4 100%);
    border: 1px solid rgba(124, 36, 52, 0.08);
    border-radius: 32px;
    padding: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
    gap: 1.5rem;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}

.admin-hero-sm {
    grid-template-columns: 1fr;
}

.admin-hero h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.04;
    font-weight: 900;
    margin: .9rem 0;
    color: #111827;
}

.admin-hero p {
    color: #64748b;
    max-width: 780px;
    margin: 0;
}

.admin-hero-actions {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}

.admin-hero-side {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.admin-metric-orb {
    width: 100%;
    min-height: 220px;
    border-radius: 30px;
    padding: 1.75rem;
    color: #fff;
    background: linear-gradient(145deg, #101828 0%, #7c2434 55%, #ff7a22 100%);
    box-shadow: 0 28px 60px rgba(124, 36, 52, 0.28);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.admin-metric-orb span,
.admin-metric-orb small {
    opacity: .82;
}

.admin-metric-orb strong {
    display: block;
    font-size: 2.5rem;
    line-height: 1.05;
    margin: .6rem 0;
}

.mini-stat-card-pro {
    position: relative;
    overflow: hidden;
}

.mini-stat-card-pro::after {
    content: '';
    position: absolute;
    inset: auto -28px -28px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 36, 52, 0.08), transparent 70%);
}

.status-grid,
.quick-actions-grid {
    display: grid;
    gap: 1rem;
}

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

.status-card {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.status-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .8rem;
}

.status-card-top strong {
    font-size: 1.3rem;
    color: #111827;
}

.admin-soft-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #475569;
    padding: .6rem .9rem;
    font-size: .85rem;
    font-weight: 700;
}

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

.quick-action-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    padding: 1.1rem;
    text-decoration: none;
    color: #0f172a;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf7 100%);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
    border-color: rgba(124, 36, 52, 0.18);
}

.quick-action-card i {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124,36,52,.1), rgba(249,115,22,.12));
    color: var(--admin-primary);
    font-size: 1.15rem;
    margin-bottom: .8rem;
}

.quick-action-card span {
    display: block;
    font-weight: 800;
    margin-bottom: .2rem;
}

.quick-action-card small {
    color: #64748b;
}

.admin-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    overflow: hidden;
}

.admin-table-modern {
    margin: 0;
}

.admin-table-modern thead th {
    background: #fcfcfd;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .78rem;
    font-weight: 800;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-table-modern tbody tr {
    transition: background-color .18s ease;
}

.admin-table-modern tbody tr:hover {
    background: rgba(124, 36, 52, 0.03);
}

.price-badge,
.service-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .55rem .85rem;
    font-size: .85rem;
    font-weight: 800;
    white-space: nowrap;
}

.price-badge {
    background: #111827;
    color: #fff;
}

.service-chip {
    background: #f8fafc;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.status-pill {
    border: 1px solid transparent;
}

.status-recibido { background: rgba(100, 116, 139, .12); color: #475569; border-color: rgba(100,116,139,.2); }
.status-confirmado { background: rgba(59, 130, 246, .12); color: #1d4ed8; border-color: rgba(59,130,246,.2); }
.status-en_preparacion { background: rgba(245, 158, 11, .14); color: #b45309; border-color: rgba(245,158,11,.24); }
.status-en_camino { background: rgba(6, 182, 212, .14); color: #0f766e; border-color: rgba(6,182,212,.24); }
.status-entregado { background: rgba(34, 197, 94, .14); color: #15803d; border-color: rgba(34,197,94,.24); }
.status-cancelado { background: rgba(239, 68, 68, .12); color: #b91c1c; border-color: rgba(239,68,68,.22); }

.admin-progress {
    height: 10px;
    border-radius: 999px;
    background: #eef2f7;
}

.status-bar-recibido { background: #64748b; }
.status-bar-en_preparacion { background: #f59e0b; }
.status-bar-en_camino { background: #06b6d4; }
.status-bar-entregado { background: #22c55e; }
.status-bar-cancelado { background: #ef4444; }

.status-mini-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    padding: 1rem 1.1rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
    height: 100%;
}

.status-mini-card span {
    display: block;
    color: #64748b;
    font-size: .84rem;
    margin-bottom: .35rem;
}

.status-mini-card strong {
    font-size: 1.8rem;
    color: #0f172a;
    line-height: 1;
}

.admin-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

@media (max-width: 1199px) {
    .admin-hero {
        grid-template-columns: 1fr;
    }

    .admin-hero-side {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .status-grid,
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .admin-hero {
        padding: 1.4rem;
        border-radius: 26px;
    }
}
