/* =========================================
   ESTILOS PANEL ADMIN NABANI (MODO CLARO)
   ========================================= */

/* Layout general del panel admin */
.admin-page {
    background: #f5f5f7;
    color: #222222;
    min-height: 100vh;
    padding: 40px 40px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Encabezado principal del admin */
.admin-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    border-bottom: 1px solid #d3d3d3;
    padding-bottom: 14px;
}

.admin-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 6px;
    color: #222222;
}

.admin-subtitle {
    margin: 0;
    font-size: 13px;
    color: #6f6f6f;
    max-width: 620px;
    line-height: 1.7;
}

/* Contenido principal */
.admin-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 20px;
}

/* Mensajes de estado */
.admin-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.admin-alert-ok {
    background: #e8f5e9;
    border-color: #388e3c;
    color: #1b5e20;
}

.admin-alert-error {
    background: #ffebee;
    border-color: #d32f2f;
    color: #b71c1c;
}

/* Grid de 2 columnas (form + tabla) */
.admin-grid-2cols {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 24px;
}

/* Tarjetas del panel admin */
.admin-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    padding: 18px 18px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.admin-card.admin-card-table {
    padding-bottom: 14px;
}

.admin-card-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #222222;
    margin: 0 0 4px;
}

.admin-card-text {
    margin: 0 0 14px;
    font-size: 13px;
    color: #555555;
}

/* Formularios admin */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.admin-form-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #444444;
    margin-bottom: 4px;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #d1d1d1;
    padding: 9px 10px;
    font-size: 13px;
    color: #222222;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.admin-form-group input::placeholder,
.admin-form-group textarea::placeholder {
    color: #a0a0a0;
    font-size: 12px;
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
    border-color: #c0c0c0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Tip de ayuda */
.admin-hint {
    font-size: 11px;
    color: #8a8a8a;
    margin-top: 4px;
}

/* Botón principal admin */
.btn-admin-primary {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid #111111;
    background: #111111;
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.btn-admin-primary:hover {
    background: #333333;
    border-color: #333333;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.admin-form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Tabla admin */
.admin-table-wrapper {
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #ffffff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table thead {
    background: #f0f0f5;
}

.admin-table thead th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 11px;
    color: #555555;
    border-bottom: 1px solid #d7d7d7;
}

.admin-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.admin-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.admin-table tbody tr:hover {
    background: #f2f2f7;
}

.admin-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e3e3e3;
    vertical-align: middle;
}

.admin-table-empty {
    text-align: center;
    padding: 16px 10px;
    color: #888888;
}

.admin-table-sub {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: #888888;
}
/* ============================
   ADMIN TABLE: Scroll + truncado
   ============================ */

/* Wrapper: permite mover la tabla horizontalmente */
.admin-table-wrapper{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Tabla: ancho mínimo para que haya scroll */
  .admin-table{
    width: 100%;
    min-width: 1200px;        /* ajusta si agregas más columnas */
    border-collapse: collapse;
  }
  
  /* Cabeceras siempre en una línea */
  .admin-table th{
    white-space: nowrap;
  }
  
  /* ============================
     COLUMNA PRODUCTO
     ============================ */
  
  /* Limita el ancho de la primera columna */
  .admin-table td:first-child{
    width: 320px;
    max-width: 320px;
    white-space: normal;     /* permite multilinea SOLO aquí */
    vertical-align: middle;
  }
  
  /* Nombre del producto: 1 línea con ... */
  .admin-table td:first-child strong{
    display: block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Descripción corta: máx. 3 líneas */
  .admin-table td:first-child .admin-table-sub{
    display: -webkit-box;
    -webkit-line-clamp: 3;       /* cambia a 2 si lo quieres más compacto */
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 320px;
    line-height: 1.45;
    color: #777;
    margin-top: 4px;
  }
  
  /* ============================
     RESTO DE COLUMNAS
     ============================ */
  
  /* Evita que SKU, precios, fechas se partan */
  .admin-table td{
    white-space: nowrap;
    vertical-align: middle;
  }
  

/* Badges para estado */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.badge-ok {
    border-color: #2e7d32;
    background: #e8f5e9;
    color: #1b5e20;
}

.badge-off {
    border-color: #c62828;
    background: #ffebee;
    color: #b71c1c;
}

/* Botones dentro de la tabla */
.inline-form {
    display: inline-block;
    margin: 0;
}

.btn-table,
.btn-table-secondary {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    border: 1px solid #c0c0c0;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
    text-decoration: none;
    margin-right: 4px;
    transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s, box-shadow 0.15s;
}

.btn-table:hover,
.btn-table-secondary:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Versión secundaria (por ejemplo, Editar) */
.btn-table-secondary {
    border-color: #9e9e9e;
}

/* Ajustes específicos de tarjetas admin (cuentas, etc.) si los usas */
.account-page {
    background: #050505;
    color: #f5f5f5;
    min-height: 100vh;
    padding: 40px 40px 60px;
}

.account-hero {
    max-width: 820px;
    margin: 0 auto 26px;
    text-align: center;
}

.account-hero h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.account-hero p {
    margin: 0;
    font-size: 14px;
    color: #c3c3c3;
    line-height: 1.7;
}

.account-grid {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
}

.account-card {
    background: #0c0c0c;
    border-radius: 14px;
    border: 1px solid #1f1f1f;
    padding: 16px 16px 18px;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.account-card h3 {
    margin: 0 0 6px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.account-card p {
    margin: 0;
    font-size: 13px;
    color: #bdbdbd;
    line-height: 1.6;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
    border-color: #c0c0c0;
    background: #101010;
}

.account-card-admin {
    border-color: #3949ab;
}

.account-card-logout {
    border-color: #b71c1c;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .admin-page {
        padding: 28px 18px 40px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .admin-grid-2cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        margin-bottom: 12px;
        border-bottom: 1px solid #e0e0e0;
    }

    .admin-table td {
        border: none;
        padding: 6px 10px;
    }

    .admin-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #888;
        margin-bottom: 2px;
    }
}

/* Arreglar que la celda de acciones no se suba */
.admin-table td {
    vertical-align: middle !important; /* <--- fuerza centrado vertical */
}

/* Mantener acciones alineadas sin empujar la fila */
.td-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    height: 100%; /* <--- evita que se pegue arriba */
}

/* Formularios dentro de acciones */
.td-actions .inline-form {
    margin: 0;
}

/* Botones dentro de la tabla */
.td-actions .btn-table,
.td-actions .btn-table-secondary {
    margin: 0;
    padding: 4px 10px;
    font-size: 11px;
}

/* ====== EXPANDABLE ROWS EN TABLAS ADMIN ====== */

.admin-table-expandable .admin-row {
    cursor: pointer;
}

/* Hover suave en filas clicables */
.admin-table-expandable .admin-row:hover {
    background: #f0f0f0;
}

/* Columna de descripción: acotamos el ancho y ponemos "..." */
.admin-table-expandable .col-descripcion {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Columna de acción: ancho fijo y sin salto de línea */
.admin-table-expandable .th-accion,
.admin-table-expandable .td-accion {
    width: 140px;
    text-align: center;
    white-space: nowrap;
}

/* Fila de detalle (contenido que se despliega) */
.admin-row-details {
    background: #fafafa;
}

.row-details-inner {
    padding: 12px 14px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #444;
}

.row-details-title {
    font-weight: 600;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    color: #777;
}

.row-details-text {
    margin: 0 0 10px;
    line-height: 1.5;
}

.row-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botón eliminar solo estilo (está deshabilitado por ahora) */
.btn-danger {
    border-color: #c62828;
    color: #c62828;
}

.btn-danger:hover {
    background: #c62828;
    color: #fff;
}

/* Modo claro para esta pantalla */
.admin-page-light {
    background: #f4f4f4;
    color: #111;
}

.admin-page-light .admin-card {
    background: #ffffff;
    color: #111111;
}

.admin-page-light .admin-table-wrapper {
    background: #ffffff;
}

.admin-page-light .admin-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.admin-page-light .admin-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}


