/* =====================================================
   STREET PATCH · ESTILO DEL PANEL DE ADMINISTRACIÓN
   Se usa en: admin.php, admin_login.php y admin_setup.php
   Solo cambia el aspecto (colores, tamaños, posiciones).
   No toca la lógica ni la base de datos.

   Índice:
   1. Colores y base
   2. Login / configuración inicial
   3. Botones, alertas y formularios
   4. Barra lateral (menú del panel)
   5. Barra superior y contenido
   6. Paneles, restaurante y tablas
   7. Formularios del panel
   8. Tablet
   9. Celular
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Poppins:wght@400;500;600;700&display=swap');


/* ========== 1. COLORES Y BASE ========== */

:root {
    /* Paleta de Street Patch (la misma de la página pública) */
    --negro:     #111414;
    --carbon:    #191E1D;
    --carbon-2:  #202726;
    --turquesa:  #21D4C2;
    --turquesa-2:#13a99a;
    --naranja:   #FF7A2F;
    --dorado:    #FFB347;
    --blanco:    #F7F5EF;
    --gris:      #B9C1BF;
    --linea:     rgba(255, 255, 255, 0.09);
    --rojo:      #ff5a4f;
    --verde:     #3ddc97;

    --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--negro);
    color: var(--blanco);
    font-family: 'Poppins', Arial, sans-serif;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Oswald', Arial, sans-serif;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

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

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

button, a {
    transition: 0.2s ease;
}

.muted {
    color: var(--gris);
}


/* ========== 2. LOGIN / CONFIGURACIÓN INICIAL ========== */

/* Fondo de la pantalla de ingreso */
.auth-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;

    background:
        radial-gradient(circle at 15% 20%, rgba(33, 212, 194, 0.22), transparent 38%),
        radial-gradient(circle at 85% 85%, rgba(255, 122, 47, 0.20), transparent 38%),
        var(--negro);
}

/* Tarjeta con el formulario */
.auth-card {
    width: min(100%, 440px);
    padding: 38px;

    background: var(--carbon);
    border: 1px solid rgba(33, 212, 194, 0.4);
    border-top: 5px solid var(--naranja);
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

/* Logo + nombre sobre el título */
.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;

    color: var(--turquesa);
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    letter-spacing: 0.12em;
}

.brand-mark img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid var(--turquesa);
    object-fit: cover;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.auth-card p {
    margin: 0 0 24px;
    color: var(--gris);
    font-size: 14px;
}

.auth-card form {
    display: grid;
    gap: 16px;
}

.auth-card small {
    display: block;
    margin-top: 17px;
    color: var(--gris);
    font-size: 12px;
}

.back-link {
    display: block;
    margin-top: 23px;
    text-align: center;
    color: var(--turquesa);
    font-size: 13px;
}

.back-link:hover {
    color: var(--naranja);
}


/* ========== 3. BOTONES, ALERTAS Y CAMPOS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 30px;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Botón principal: turquesa */
.btn.primary {
    background: var(--turquesa);
    color: var(--negro);
    box-shadow: 0 6px 16px rgba(33, 212, 194, 0.25);
}

.btn.primary:hover {
    background: var(--naranja);
}

/* Botón secundario */
.btn.light {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--linea);
    color: var(--blanco);
}

.btn.light:hover {
    border-color: var(--turquesa);
    color: var(--turquesa);
}

/* Botón de peligro (borrar) */
.btn.danger-outline {
    background: transparent;
    border-color: rgba(255, 90, 79, 0.6);
    color: var(--rojo);
}

.btn.danger-outline:hover {
    background: var(--rojo);
    color: #fff;
}

.btn.full {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
}

.btn.small-btn {
    padding: 8px 12px;
}

/* Avisos */
.alert {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
}

.alert.success {
    background: rgba(61, 220, 151, 0.12);
    border: 1px solid rgba(61, 220, 151, 0.5);
    color: var(--verde);
}

.alert.error {
    background: rgba(255, 90, 79, 0.12);
    border: 1px solid rgba(255, 90, 79, 0.5);
    color: #ff8f87;
}

/* Etiquetas y campos de texto (login y formularios del panel) */
.auth-card label,
.editor-grid label {
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.auth-card input,
.editor-grid input,
.editor-grid select,
.editor-grid textarea,
.inline-form select,
.table-tools input {
    width: 100%;
    padding: 12px 14px;

    background: var(--negro);
    border: 1px solid rgba(33, 212, 194, 0.35);
    border-radius: 12px;
    outline: none;

    color: var(--blanco);
}

.auth-card input:focus,
.editor-grid input:focus,
.editor-grid select:focus,
.editor-grid textarea:focus,
.inline-form select:focus,
.table-tools input:focus {
    border-color: var(--turquesa);
    box-shadow: 0 0 0 3px rgba(33, 212, 194, 0.18);
}

/* Las opciones desplegables también oscuras */
select option {
    background: var(--carbon);
    color: var(--blanco);
}


/* ========== 4. BARRA LATERAL (MENÚ DEL PANEL) ========== */

.dashboard {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;

    width: 250px;
    padding: 24px 14px;

    display: flex;
    flex-direction: column;

    background: linear-gradient(180deg, #0c0f0f, #141918);
    border-right: 1px solid rgba(33, 212, 194, 0.3);
    color: var(--blanco);

    overflow-y: auto;
}

/* Logo y nombre arriba del menú */
.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px 24px;

    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.1em;
}

.side-brand img {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--turquesa);
    object-fit: cover;
}

.side-brand span {
    font-size: 30px;
}

.side-brand i {
    font-style: normal;
    color: var(--naranja);
}

.side-caption {
    padding: 0 16px 12px;
    color: var(--turquesa);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
}

/* Cada opción del menú */
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    padding: 12px 16px;

    border-left: 3px solid transparent;
    border-radius: 0 12px 12px 0;

    color: var(--gris);
    font-size: 14px;
}

.side-link > span {
    font-weight: 500;
}

.side-link:hover {
    background: rgba(33, 212, 194, 0.1);
    color: var(--blanco);
}

/* Opción activa: franja naranja */
.side-link.active {
    background: rgba(33, 212, 194, 0.16);
    border-left-color: var(--naranja);
    color: var(--turquesa);
}

/* "Cerrar sesión" va abajo del todo */
.side-bottom {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--linea);
}


/* ========== 5. BARRA SUPERIOR Y CONTENIDO ========== */

.main-area {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;

    height: 68px;
    padding: 0 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(17, 20, 20, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--linea);
    font-size: 13px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;

    background: rgba(33, 212, 194, 0.14);
    border: 1px solid var(--turquesa);
    border-radius: 50%;
    font-size: 19px;
}

.user-pill b,
.user-pill small {
    display: block;
}

.user-pill small {
    color: var(--turquesa);
    font-size: 11px;
}

.content {
    max-width: 1500px;
    margin: auto;
    padding: 30px 34px 50px;
}

/* Saludo de bienvenida */
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 24px 28px;

    background: linear-gradient(135deg, rgba(33, 212, 194, 0.14), rgba(255, 122, 47, 0.12));
    border: 1px solid rgba(33, 212, 194, 0.3);
    border-radius: 18px;
}

.welcome h1 {
    margin: 4px 0 8px;
    font-size: 30px;
}

.welcome p:not(.eyebrow) {
    margin: 0;
    color: var(--gris);
}

/* Texto pequeño sobre los títulos */
.eyebrow {
    margin: 0 0 8px;
    color: var(--turquesa);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.content > section[id] {
    scroll-margin-top: 90px;
}


/* ========== 6. PANELES, RESTAURANTE Y TABLAS ========== */

.panel {
    margin-bottom: 22px;
    overflow: hidden;

    background: var(--carbon);
    border: 1px solid var(--linea);
    border-radius: 18px;
    box-shadow: var(--sombra);
}

.filter-panel {
    padding: 16px 22px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 640px;
}

.inline-form label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.inline-form select {
    max-width: 330px;
}

/* Tarjeta del restaurante: imagen | datos | botones */
.restaurant-panel {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 190px;
    gap: 22px;
    align-items: center;
    padding: 22px;
    border-left: 4px solid var(--naranja);
}

.restaurant-image {
    display: grid;
    place-items: center;
    height: 136px;
    overflow: hidden;

    background: var(--negro);
    border: 1px solid rgba(33, 212, 194, 0.35);
    border-radius: 14px;
}

.restaurant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-image span {
    font-size: 50px;
}

.restaurant-info h2 {
    margin: 0;
    font-size: 22px;
}

.title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.restaurant-info p {
    margin: 9px 0;
    color: var(--gris);
    font-size: 13px;
}

.meta-row {
    margin-top: 8px;
    color: var(--gris);
    font-size: 12px;
}

/* Estado: disponible / oculto */
.status {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status.on {
    background: rgba(61, 220, 151, 0.14);
    color: var(--verde);
}

.status.off {
    background: rgba(255, 179, 71, 0.15);
    color: var(--dorado);
}

.restaurant-actions {
    display: grid;
    gap: 10px;
}

/* Encabezado de cada sección */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 16px;
}

.section-heading h2,
.form-heading h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.section-heading p:not(.eyebrow),
.form-heading p:not(.eyebrow) {
    margin: 0;
    color: var(--gris);
    font-size: 13px;
}

/* Tabla de platillos */
.product-panel {
    padding: 20px;
}

.table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.table-tools input {
    max-width: 420px;
}

.count-chip {
    padding: 7px 13px;
    background: rgba(33, 212, 194, 0.14);
    border-radius: 30px;
    color: var(--turquesa);
    font-size: 12px;
    font-weight: 600;
}

/* La tabla se desliza de lado en pantallas pequeñas */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

th {
    background: rgba(33, 212, 194, 0.1);
    color: var(--turquesa);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

th, td {
    padding: 12px 11px;
    border-bottom: 1px solid var(--linea);
    vertical-align: middle;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.food-thumb,
.food-placeholder {
    width: 54px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--negro);
}

.food-placeholder {
    display: grid;
    place-items: center;
    font-size: 24px;
}

.desc-cell {
    display: block;
    max-width: 270px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--gris);
    font-size: 11px;
}

.category-chip {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255, 122, 47, 0.14);
    border-radius: 30px;
    color: var(--dorado);
    white-space: nowrap;
}

.price-cell {
    color: var(--turquesa);
    font-weight: 700;
    white-space: nowrap;
}

.actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.actions form {
    margin: 0;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

.icon-btn:hover {
    transform: translateY(-2px);
}

.icon-btn.edit {
    background: rgba(61, 220, 151, 0.15);
    color: var(--verde);
}

.icon-btn.delete {
    background: rgba(255, 90, 79, 0.15);
    color: var(--rojo);
}

/* Mensaje cuando no hay datos */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    padding: 36px;
    text-align: center;
    color: var(--gris);
}

.empty-state:first-line {
    font-size: 30px;
}

.empty-state b {
    color: var(--blanco);
    font-size: 16px;
}


/* ========== 7. FORMULARIOS DEL PANEL ========== */

.form-panel {
    padding: 24px;
}

.form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

/* Campos en 2 columnas */
.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.editor-grid label small {
    color: var(--gris);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.editor-grid textarea {
    min-height: 84px;
    resize: vertical;
}

.full-field {
    grid-column: 1 / -1;
}

.upload-field {
    align-content: start;
}

/* Cuadro punteado para subir imágenes */
.upload-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    min-height: 118px;
    padding: 15px;

    background: rgba(33, 212, 194, 0.05);
    border: 2px dashed rgba(33, 212, 194, 0.5);
    border-radius: 14px;

    color: var(--turquesa);
    text-align: center;
    cursor: pointer;
}

.upload-box:hover {
    background: rgba(33, 212, 194, 0.1);
}

.upload-box b {
    font-size: 12px;
}

.upload-box small {
    color: var(--gris);
    font-size: 11px;
}

/* El campo de archivo real queda invisible sobre todo el cuadro */
.upload-box input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.check-label {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    font-size: 12px !important;
}

.check-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--turquesa);
}

.form-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.form-submit .btn {
    min-width: 190px;
}

.footer-note {
    padding: 10px 0 25px;
    text-align: center;
    color: var(--gris);
    font-size: 11px;
}


/* ========== 8. TABLET ========== */

@media (max-width: 1100px) {

    .sidebar {
        width: 210px;
    }

    .main-area {
        margin-left: 210px;
    }

    .content {
        padding: 24px 20px;
    }

    /* Restaurante: imagen y datos arriba, botones en una fila abajo */
    .restaurant-panel {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .restaurant-actions {
        grid-column: 1 / -1;
        display: flex;
    }

    .restaurant-actions > * {
        flex: 1;
    }

    .restaurant-image {
        height: 124px;
    }
}


/* ========== 9. CELULAR ========== */
/* El menú lateral pasa a ser una barra horizontal fija arriba,
   con las opciones deslizables y con su texto visible. */

@media (max-width: 760px) {

    .sidebar {
        position: sticky;
        top: 0;
        inset: auto;
        width: auto;
        height: auto;
        padding: 10px 12px;

        flex-direction: row;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;

        border-right: 0;
        border-bottom: 2px solid var(--turquesa);
        -webkit-overflow-scrolling: touch;
    }

    .side-brand {
        flex-shrink: 0;
        padding: 0 10px 0 2px;
        font-size: 14px;
    }

    .side-brand img {
        width: 38px;
        height: 38px;
    }

    .side-brand b {
        display: block;
    }

    /* Se ocultan los títulos y se muestran todas las opciones en fila */
    .side-caption {
        display: none;
    }

    .side-link {
        flex-shrink: 0;
        margin: 0;
        padding: 9px 13px;

        background: rgba(255, 255, 255, 0.06);
        border-left: 0;
        border-radius: 30px;
        font-size: 12px;
        white-space: nowrap;
    }

    .side-link.active {
        background: var(--turquesa);
        color: var(--negro);
    }

    /* "Cerrar sesión" sigue visible, al final de la fila */
    .side-bottom {
        display: flex;
        margin: 0;
        padding: 0;
        border: 0;
        flex-shrink: 0;
    }

    .side-bottom .side-link {
        background: rgba(255, 90, 79, 0.15);
        color: var(--rojo);
    }

    .main-area {
        margin-left: 0;
    }

    .topbar {
        position: static;
        height: 58px;
        padding: 0 15px;
    }

    .topbar > div:first-child {
        font-size: 11px;
    }

    .topbar .muted {
        display: none;
    }

    .user-pill small {
        display: none;
    }

    .content {
        padding: 20px 13px;
    }

    .welcome {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .welcome h1 {
        font-size: 25px;
    }

    .welcome > .btn {
        width: 100%;
    }

    .restaurant-panel {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .restaurant-image {
        height: 175px;
    }

    .restaurant-actions {
        display: grid;
        grid-column: auto;
    }

    .restaurant-info h2 {
        font-size: 20px;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-heading > .btn {
        width: 100%;
    }

    .product-panel {
        padding: 12px;
    }

    .table-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .table-tools input {
        max-width: none;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .full-field {
        grid-column: auto;
    }

    .form-panel {
        padding: 16px;
    }

    .form-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-submit .btn {
        width: 100%;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form select {
        max-width: none;
    }

    .auth-card {
        padding: 28px 22px;
    }
}


/* =====================================================
   PEDIDOS DEL RESTAURANTE (admin.php)
   Tarjetas con el detalle de cada pedido y botones de WhatsApp.
===================================================== */
.pedido-card {
    padding: 18px 22px;
}

.pedido-vacio {
    padding: 22px;
    color: var(--gris);
    text-align: center;
}

.pedido-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 15px;
}

.pedido-datos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.pedido-datos div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.pedido-datos small {
    color: var(--gris);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pedido-datos span {
    color: var(--gris);
}

.pedido-lineas {
    margin: 0 0 12px;
    padding: 10px 14px;
    list-style: none;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 13px;
}

.pedido-lineas li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
}

.pedido-notas {
    margin: 0 0 12px;
    color: var(--dorado);
    font-size: 13px;
}

.pedido-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.pedido-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 760px) {
    .pedido-datos {
        grid-template-columns: 1fr;
    }
}
