* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: #f8f9fc;
    color: #1c2130;
}

.error-msg {
    color: #d64545;
    font-size: 13px;
    min-height: 18px;
}

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

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #14172a;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.login-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #4f6bde;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.login-card .subtitle {
    color: #6b7280;
    font-size: 13.5px;
    margin-bottom: 6px;
}

/* ==================== INPUTS / BUTTONS ==================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="color"],
textarea {
    background: #fff;
    border: 1px solid #dde1ea;
    color: #1c2130;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #4f6bde;
    box-shadow: 0 0 0 3px rgba(79, 107, 222, 0.15);
}

label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #4b5468;
    margin: 12px 0 5px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #4f6bde;
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover { background: #3d57c4; }

.btn-secondary {
    background: #fff;
    color: #1c2130;
    border: 1px solid #dde1ea;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    font-family: inherit;
}

.btn-secondary:hover { border-color: #4f6bde; color: #4f6bde; }

/* ==================== APP SHELL ==================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: #171a2e;
    color: #cdd1e0;
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
}

.sidebar-logo, .login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    margin-bottom: 36px;
}

.sidebar-logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #4f6bde;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6a7091;
    margin: 0 0 10px 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #a8adc4;
    cursor: default;
}

.sidebar-nav-item.active {
    background: #262a45;
    color: #fff;
    font-weight: 600;
}

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: #1f2340;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4f6bde;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.sidebar-logout {
    background: none;
    border: none;
    color: #8b91ac;
    font-size: 11.5px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.sidebar-logout:hover { color: #fff; }

.main-area {
    flex: 1;
    padding: 36px 44px;
    max-width: 1200px;
}

/* ==================== PAGE HEADER / STATS ==================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.page-header h1 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e7e9f2;
    border-radius: 14px;
    padding: 18px 20px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 6px;
}

/* ==================== TABLE ==================== */

.table-card {
    background: #fff;
    border: 1px solid #e7e9f2;
    border-radius: 14px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1.4fr 1fr 1fr 0.8fr;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f1f7;
}

.table-row:last-child { border-bottom: none; }

.table-head {
    font-size: 11.5px;
    font-weight: 700;
    color: #6b7280;
    background: #fafafe;
    padding: 13px 20px;
}

.negocio-nombre {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.negocio-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.negocio-slug {
    font-size: 12.5px;
    color: #6b7280;
    font-family: monospace;
}

.plan-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}

.plan-badge.pro { background: #e8ecfb; color: #3d57c4; }
.plan-badge.free { background: #eef0f4; color: #565d70; }

.estado-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.estado-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.estado-dot.activo { background: #34b171; }
.estado-dot.suspendido { background: #9aa0b4; }

.btn-editar-row {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #4f6bde;
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    justify-self: end;
}

.btn-editar-row:hover { text-decoration: underline; }

/* ==================== TABS ==================== */

.tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e7e9f2;
    margin-bottom: 22px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-btn.active {
    color: #4f6bde;
    border-bottom-color: #4f6bde;
}

.tab-btn.disabled-page {
    color: #c2c6d4;
    text-decoration: line-through;
}

.paginas-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 4px;
}

.paginas-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: #1c2130;
    margin: 0;
}

.paginas-toggle input {
    width: auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

select {
    background: #fff;
    border: 1px solid #dde1ea;
    color: #1c2130;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

/* ==================== HORARIO ==================== */

.horario-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.horario-row {
    display: grid;
    grid-template-columns: 90px 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.horario-row .dia-label {
    font-size: 13px;
    font-weight: 600;
}

.horario-row label.cerrado-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
}

.horario-row input[type="checkbox"] {
    width: auto;
}

/* ==================== GALERÍA ==================== */

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.galeria-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e7e9f2;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-item .btn-remove-galeria {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.galeria-item-empty {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1.5px dashed #dde1ea;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8b91ac;
    font-size: 12px;
    position: relative;
}

.galeria-item-empty input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ==================== EDITOR ==================== */

.editor-section {
    border: 1px solid #e7e9f2;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
    background: #fff;
}

.editor-section legend {
    color: #4f6bde;
    padding: 0 8px;
    font-weight: 700;
    font-size: 14px;
}

.field-hint {
    color: #8b91ac;
    font-size: 12px;
    margin-bottom: 10px;
}

.repeater {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.repeater-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto;
    gap: 8px;
    align-items: center;
    background: #f8f9fc;
    border: 1px solid #eceef5;
    border-radius: 10px;
    padding: 10px;
}

.repeater-row input {
    margin: 0;
}

/* ==================== UPLOAD FIELDS ==================== */

.upload-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-field-small {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.upload-preview {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #dde1ea;
    flex-shrink: 0;
}

.upload-field-small .upload-preview,
.upload-field-small .upload-preview-empty {
    width: 100%;
    height: 72px;
}

.upload-preview-empty {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 1.5px dashed #dde1ea;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    color: #8b91ac;
    flex-shrink: 0;
    text-align: center;
}

.upload-field input[type="file"] {
    font-size: 12px;
    width: auto;
    padding: 0;
    border: none;
}

.btn-remove-row {
    background: none;
    border: 1px solid #d64545;
    color: #d64545;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
}

.btn-add { width: 100%; justify-content: center; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}
