/* ============================================
   DAYLI STORE - Admin Panel Styles
   Sigue el design system: Oswald/Inter,
   negro/blanco/#F2F2F2, 0px radius, flat.
   ============================================ */

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F2F2F2;
    padding: 24px;
}

.login-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    text-align: center;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 32px;
}

.login-brand .logo-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.login-brand .brand-name {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #000000;
    text-transform: uppercase;
}

.login-title {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 13px;
    color: #555555;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #000000;
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #000000;
}

.login-error {
    color: #D32F2F;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

.login-hint {
    margin-top: 28px;
    padding: 14px;
    background: #F2F2F2;
    font-size: 12px;
    color: #555555;
    line-height: 1.6;
}

.login-hint code {
    background: #FFFFFF;
    padding: 2px 6px;
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: #000000;
}

.login-back {
    display: inline-block;
    margin-top: 24px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    text-decoration: none;
}

/* ===== ADMIN LAYOUT ===== */
.admin-page {
    min-height: 100vh;
    background: #F2F2F2;
}

.admin-header {
    background: #000000;
    color: #FFFFFF;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header .logo-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.admin-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-btn {
    background: #FFFFFF;
    color: #000000;
    border: none;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.admin-btn:hover {
    background: #F2F2F2;
}

.admin-btn.danger {
    background: #D32F2F;
    color: #FFFFFF;
}

.admin-btn.danger:hover {
    background: #B71C1C;
}

.admin-btn.dark {
    background: #000000;
    color: #FFFFFF;
}

.admin-btn.dark:hover {
    background: #333333;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.admin-page-title {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.admin-page-subtitle {
    font-size: 13px;
    color: #555555;
    margin-bottom: 24px;
}

/* ===== STATS ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #FFFFFF;
    padding: 20px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555555;
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #000000;
}

/* ===== TOOLBAR ===== */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-search input {
    border: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    width: 240px;
    outline: none;
}

.admin-search input:focus {
    border-color: #000000;
}

.admin-search select {
    border: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: #FFFFFF;
    outline: none;
    cursor: pointer;
}

/* ===== TABLE ===== */
.admin-table-wrap {
    background: #FFFFFF;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555555;
    border-bottom: 2px solid #000000;
    background: #F2F2F2;
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #E0E0E0;
    vertical-align: middle;
}

.admin-table tr:hover {
    background: #FAFAFA;
}

.admin-table .col-img {
    width: 60px;
}

.admin-thumb {
    width: 48px;
    height: 48px;
    background: #F2F2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #555555;
    overflow: hidden;
}

.admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table .col-actions {
    width: 140px;
    text-align: right;
    white-space: nowrap;
}

.admin-table .row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.row-btn {
    border: 1px solid #E0E0E0;
    background: #FFFFFF;
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.row-btn:hover {
    border-color: #000000;
    background: #000000;
    color: #FFFFFF;
}

.row-btn.danger:hover {
    background: #D32F2F;
    border-color: #D32F2F;
}

.row-btn.dark {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
}

.row-btn.dark:hover {
    background: #FFFFFF;
    color: #000000;
}

.badge-pill {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pill.sale {
    background: #D32F2F;
    color: #FFFFFF;
}

.badge-pill.dark {
    background: #000000;
    color: #FFFFFF;
}

.badge-pill.none {
    background: #F2F2F2;
    color: #999999;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #555555;
    font-size: 14px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #FFFFFF;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #000000;
    display: flex;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #E0E0E0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== CONTENT SECTION (Hero + Categorías) ===== */
.content-section {
    background: #FFFFFF;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #E0E0E0;
}

.content-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #000000;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.content-grid .form-group.full {
    grid-column: 1 / -1;
}

.content-grid textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E0E0E0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.content-grid input,
.content-grid textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E0E0E0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.content-grid input:focus,
.content-grid textarea:focus {
    outline: none;
    border-color: #000000;
}

.content-section .admin-btn {
    margin-top: 4px;
}

/* ============================================
   ADMIN - Gestión de Pedidos
   ============================================ */

/* Stats cards de pedidos */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.orders-stat-card {
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    padding: 20px;
    text-align: center;
}

.orders-stat-card .stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #000;
    line-height: 1;
    margin-bottom: 6px;
}

.orders-stat-card .stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.orders-stat-card.pendiente .stat-value { color: #856404; }
.orders-stat-card.enviado .stat-value { color: #0C5460; }
.orders-stat-card.recibido .stat-value { color: #155724; }

/* Toolbar de pedidos */
.orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.orders-search {
    padding: 10px 16px;
    border: 1px solid #E0E0E0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    width: 280px;
    max-width: 100%;
}

.orders-search:focus {
    outline: none;
    border-color: #000;
}

/* Tabla de pedidos */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
}

.orders-table th {
    background: #000;
    color: #FFF;
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 12px;
    text-align: left;
    white-space: nowrap;
}

.orders-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #E0E0E0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #000;
    vertical-align: middle;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tr:hover td {
    background: #F2F2F2;
}

.orders-table .order-id-cell {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    white-space: nowrap;
}

.orders-table .order-customer-cell {
    font-weight: 600;
}

.orders-table .order-total-cell {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
}

/* Select de cambio de estado */
.order-status-select {
    padding: 6px 10px;
    border: 1px solid #E0E0E0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: #FFFFFF;
    cursor: pointer;
}

.order-status-select:focus {
    outline: none;
    border-color: #000;
}

/* Botón VER detalle */
.order-view-btn {
    padding: 6px 14px;
    background: #000;
    color: #FFF;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.order-view-btn:hover { opacity: 0.8; }

/* Estado vacío admin */
.orders-empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #555;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

/* Responsive admin pedidos */
@media (max-width: 900px) {
    .orders-stats { grid-template-columns: repeat(2, 1fr); }
    .orders-table { font-size: 12px; }
    .orders-table th, .orders-table td { padding: 10px 8px; }
    .orders-search { width: 100%; }
}

.categories-admin-toolbar {
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-preview {
    width: 100%;
    height: 160px;
    background: #F2F2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #E0E0E0;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .placeholder {
    color: #999999;
    font-size: 13px;
}

.image-upload input[type="file"] {
    font-size: 12px;
}

.image-hint {
    font-size: 11px;
    color: #555555;
}

/* ===== NOVEDAD CHECKBOX ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #000;
    border: 2px solid #000;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #000;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .admin-search input {
        width: 100%;
    }
    .admin-search {
        flex-wrap: wrap;
        width: 100%;
    }
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 24px;
    }
}
