/* ═══════════════════════════════════════════
   OPINIÓN IBÉRICA TOOLS — style.css
   Un solo CSS para toda la plataforma
   ═══════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
    --bg: #07070a;
    --bg2: #0d0d12;
    --surface: #111117;
    --surface2: #18181f;
    --surface3: #1f1f28;
    --surface4: #282833;
    --border: #252530;
    --border2: #32323f;
    --text: #eaeaf0;
    --text2: #b0b0c0;
    --text3: #70708a;
    --text4: #50506a;
    --red: #922b21;
    --red2: #b83227;
    --red3: #c0392b;
    --red-glow: rgba(146, 43, 33, 0.25);
    --red-glow2: rgba(192, 57, 43, 0.15);
    --green: #1e8449;
    --green2: #27ae60;
    --blue: #2471a3;
    --yellow: #d4ac0d;
    --orange: #e67e22;
    --radius: 10px;
    --radius2: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow2: 0 2px 10px rgba(0, 0, 0, 0.3);
    --sidebar-w: 240px;
}

/* ── RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
}

input, textarea, select {
    font-family: 'Outfit', sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ═══════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 30% 20%, rgba(146, 43, 33, 0.08), transparent),
        radial-gradient(ellipse 500px 500px at 70% 80%, rgba(146, 43, 33, 0.05), transparent);
    pointer-events: none;
}

.login-box {
    width: 380px;
    max-width: 92vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow), 0 0 80px rgba(146, 43, 33, 0.06);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--red), var(--red3));
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 16px var(--red-glow);
}

.login-logo-text {
    font-size: 16px;
    font-weight: 700;
}

.login-logo-text span {
    color: var(--text3);
    font-weight: 400;
    font-size: 14px;
    display: block;
    margin-top: 1px;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-field input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.login-field input::placeholder {
    color: var(--text4);
}

.login-btn {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--red), var(--red3));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--red-glow);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--red-glow);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text4);
}

.login-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.2);
    color: var(--red3);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   INSTALL
   ═══════════════════════════════════════════ */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.install-box {
    width: 480px;
    max-width: 94vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow);
}

.install-box h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.install-box p {
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 24px;
}

.install-success {
    background: rgba(30, 132, 73, 0.1);
    border: 1px solid rgba(30, 132, 73, 0.2);
    color: var(--green2);
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.install-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.2);
    color: var(--red3);
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════ */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-mark {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--red), var(--red3));
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    box-shadow: 0 2px 10px var(--red-glow);
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-logo-text span {
    color: var(--text4);
    font-weight: 400;
    font-size: 10px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text4);
    font-weight: 600;
    padding: 12px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    transition: all 0.15s;
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--surface2);
    color: var(--text2);
}

.sidebar-link.active {
    background: var(--red-glow2);
    color: var(--text);
}

.sidebar-link.active .sidebar-icon {
    color: var(--red3);
}

.sidebar-link.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
}

.sidebar-badge.soon {
    background: var(--surface3);
    color: var(--text4);
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--surface3), var(--surface4));
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text3);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text4);
}

.sidebar-logout {
    font-size: 16px;
    color: var(--text4);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s;
    background: none;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.sidebar-logout:hover {
    color: var(--red3);
    background: var(--red-glow2);
}

/* ═══════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════ */
.page-header {
    padding: 24px 32px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}

.page-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--text3);
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ═══════════════════════════════════════════
   DASHBOARD — STATS
   ═══════════════════════════════════════════ */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 20px;
    animation: fadeIn 0.35s ease both;
}

.stat-card:nth-child(2) { animation-delay: 0.04s; }
.stat-card:nth-child(3) { animation-delay: 0.08s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }

.stat-card-label {
    font-size: 12px;
    color: var(--text4);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    margin: 6px 0 2px;
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text3);
}

.stat-card-sub.green {
    color: var(--green2);
}

/* ═══════════════════════════════════════════
   DASHBOARD — TOOL CARDS
   ═══════════════════════════════════════════ */
.dash-tools-header {
    padding: 28px 32px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text4);
    font-weight: 600;
}

.dash-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0 32px 32px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
}

.tool-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow2);
}

.tool-card.primary:hover {
    border-color: var(--red);
    box-shadow: 0 4px 24px var(--red-glow);
}

.tool-card.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.tool-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.tool-card-badge.active {
    background: var(--green);
    color: #fff;
}

.tool-card-badge.soon {
    background: var(--surface3);
    color: var(--text4);
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 20px;
    margin-bottom: 16px;
    background: var(--surface3);
}

.tool-card.primary .tool-card-icon {
    background: linear-gradient(135deg, var(--red), var(--red3));
    box-shadow: 0 4px 16px var(--red-glow);
}

.tool-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-card-desc {
    font-size: 12px;
    color: var(--text3);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   FORMULARIOS GENERALES
   ═══════════════════════════════════════════ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
}

.field input,
.field textarea,
.field select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 13px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.field textarea {
    resize: vertical;
    min-height: 68px;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text4);
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2370708a' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.field select option {
    background: var(--surface);
}

.field-bg-dark input,
.field-bg-dark textarea,
.field-bg-dark select {
    background: var(--bg);
}

/* ═══════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════ */
.btn-primary {
    padding: 8px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--red), var(--red3));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    box-shadow: 0 2px 12px var(--red-glow);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--red-glow);
}

.btn-gen {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--red), var(--red3));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 20px var(--red-glow);
    border: none;
    cursor: pointer;
}

.btn-gen:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--red-glow);
}

.btn-gen:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-save {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}

.btn-save:hover {
    background: var(--green2);
}

.btn-sm {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text3);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
    cursor: pointer;
}

.btn-sm:hover {
    border-color: var(--border2);
    color: var(--text);
    background: var(--surface2);
}

.btn-sm.success {
    border-color: var(--green);
    color: var(--green2);
}

/* ═══════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   POST GENERATOR — LAYOUT
   ═══════════════════════════════════════════ */
.gen-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    flex: 1;
}

.gen-left {
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.gen-left .field {
    margin-bottom: 0;
}

.gen-right {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.gen-divider {
    height: 1px;
    background: var(--border);
}

.gen-hint {
    font-size: 11px;
    color: var(--text4);
    line-height: 1.6;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.gen-hint strong {
    color: var(--text3);
}

/* ── Tabs & Toolbar ── */
.gen-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border-radius: 8px;
    padding: 3px;
}

.tab {
    padding: 6px 16px;
    background: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}

.tab.active {
    background: var(--surface3);
    color: var(--text);
}

.tab:hover:not(.active) {
    color: var(--text2);
}

.gen-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text4);
    font-family: 'IBM Plex Mono', monospace;
}

/* ── Preview ── */
.gen-preview {
    flex: 1;
    background: #fff;
    border-radius: var(--radius2);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gen-preview-bar {
    background: #f2f2f4;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #e0e0e0;
}

.prev-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.prev-dot.r { background: #ff5f57; }
.prev-dot.y { background: #febc2e; }
.prev-dot.g { background: #28c840; }

.prev-url {
    flex: 1;
    text-align: center;
    font-size: 10px;
    color: #aaa;
    font-family: 'IBM Plex Mono', monospace;
}

.gen-preview-body {
    padding: 28px;
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    max-height: 68vh;
    overflow-y: auto;
}

.gen-preview-body h2 {
    font-size: 22px;
    margin: 24px 0 12px;
    color: #1a1a1a;
}

.gen-preview-body p {
    margin-bottom: 14px;
}

/* ── Code view ── */
.gen-code {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 18px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 68vh;
    overflow-y: auto;
    display: none;
}

/* ── Empty state ── */
.gen-empty {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
    font-size: 14px;
}

.gen-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.gen-empty-title {
    font-weight: 600;
    color: #999;
    margin-bottom: 4px;
}

.gen-empty-sub {
    font-size: 12px;
}

/* ═══════════════════════════════════════════
   ADMIN — TABLAS
   ═══════════════════════════════════════════ */
.admin-content {
    padding: 24px 32px;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-search {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    width: 260px;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.admin-search:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.admin-search::placeholder {
    color: var(--text4);
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--surface2);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--surface2);
}

/* Badges de rol */
.role-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 6px;
    font-weight: 600;
}

.role-badge.admin {
    background: rgba(146, 43, 33, 0.15);
    color: var(--red3);
}

.role-badge.editor {
    background: rgba(36, 113, 163, 0.15);
    color: var(--blue);
}

.role-badge.normal {
    background: rgba(30, 132, 73, 0.15);
    color: var(--green2);
}

/* Acciones en tablas */
.table-actions {
    display: flex;
    gap: 4px;
}

.table-actions button,
.table-actions a {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface3);
    color: var(--text3);
    border: 1px solid var(--border);
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.table-actions button:hover,
.table-actions a:hover {
    border-color: var(--border2);
    color: var(--text);
}

.table-actions .danger:hover {
    border-color: var(--red);
    color: var(--red3);
    background: var(--red-glow2);
}

/* ═══════════════════════════════════════════
   ADMIN — SETTINGS
   ═══════════════════════════════════════════ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    padding: 24px;
}

.settings-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-card-desc {
    font-size: 12px;
    color: var(--text4);
    margin-bottom: 18px;
}

/* ═══════════════════════════════════════════
   HISTORY — FILTROS
   ═══════════════════════════════════════════ */
.hist-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.hist-select {
    padding: 7px 30px 7px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    outline: none;
    font-family: 'Outfit', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2370708a' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.hist-title {
    color: var(--text);
    font-weight: 600;
}

.type-evergreen {
    color: var(--green2);
}

.type-temporal {
    color: var(--orange);
}

.cost-cell {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text3);
}

.tokens-cell {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text4);
}

/* ═══════════════════════════════════════════
   MODAL SIMPLE
   ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 460px;
    max-width: 92vw;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--surface3);
    color: var(--text3);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    color: var(--text);
    border-color: var(--border2);
}

/* ═══════════════════════════════════════════
   ALERTS / MENSAJES
   ═══════════════════════════════════════════ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(30, 132, 73, 0.1);
    border: 1px solid rgba(30, 132, 73, 0.2);
    color: var(--green2);
}

.alert-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.2);
    color: var(--red3);
}

/* ═══════════════════════════════════════════
   ANIMACIONES
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .gen-layout {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .dash-stats {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .dash-tools {
        padding: 0 16px 16px;
    }

    .admin-content {
        padding: 16px;
    }

    .page-header {
        padding: 16px;
    }

    .gen-left, .gen-right {
        padding: 16px;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-search {
        width: 100%;
    }

    .gen-top {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════
   HUB CARDS
   ═══════════════════════════════════════ */

.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 820px;
    margin-top: 8px;
}

.hub-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hub-card:hover {
    border-color: var(--red3);
    background: #111118;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(146,43,33,0.15);
}

.hub-card-icon { font-size: 32px; margin-bottom: 14px; }
.hub-card-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.hub-card-desc { font-size: 12px; color: var(--text4); line-height: 1.6; margin-bottom: 14px; }

.hub-card-counters { display: flex; gap: 8px; flex-wrap: wrap; }

.hub-chip {
    display: inline-block;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.hub-chip.pending { background: rgba(243,156,18,0.12); color: #f39c12; }
.hub-chip.done { background: rgba(39,174,96,0.12); color: #2ecc71; }

.hub-card-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--border);
    transition: all 0.2s;
}
.hub-card:hover .hub-card-arrow { color: var(--red3); right: 16px; }

.hub-card.soon { opacity: 0.35; pointer-events: none; }
.hub-card.soon::after {
    content: 'PRÓXIMAMENTE';
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text4);
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text4);
    margin-bottom: 8px;
}
.breadcrumb a {
    color: var(--red3);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #333; }

/* ═══════════════════════════════════════
   SIDEBAR SUB-ITEMS
   ═══════════════════════════════════════ */

.sidebar-sub {
    display: block;
    padding: 6px 12px 6px 38px;
    font-size: 12px;
    color: var(--text4);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.15s;
}
.sidebar-sub:hover { color: #aaa; background: #111118; }
.sidebar-sub.active { color: var(--red3); font-weight: 600; }

/* ═══════════════════════════════════════
   TASK LIST (title checklist)
   ═══════════════════════════════════════ */

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    max-width: 820px;
}
.task-counter { font-size: 13px; color: var(--text4); }
.task-counter strong { color: var(--text); }

.task-filters { display: flex; gap: 6px; }
.task-filter {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text4);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.task-filter:hover { border-color: var(--red3); color: var(--text3); }
.task-filter.active { background: rgba(146,43,33,0.15); border-color: rgba(146,43,33,0.3); color: #e74c3c; }

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    max-width: 820px;
    transition: all 0.15s;
}
.task-item:hover { border-color: #2a2a34; background: #111118; }
.task-item.done { opacity: 0.45; }
.task-item.done .task-title { text-decoration: line-through; color: var(--text4); }

.task-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
    font-size: 12px;
    color: transparent;
}
.task-check:hover { border-color: var(--red3); }
.task-check.checked { background: var(--red3); border-color: var(--red3); color: #fff; }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: #ddd; margin-bottom: 3px; }
.task-meta { font-size: 11px; color: #444; }
.task-meta span { color: #666; }

.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.task-btn {
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text4);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.task-btn:hover { border-color: var(--red3); color: #e74c3c; background: rgba(146,43,33,0.08); }
.task-btn.primary { background: var(--red3); border-color: var(--red3); color: #fff; }
.task-btn.primary:hover { background: #a93226; }

/* ═══════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════ */

.admin-panel {
    max-width: 820px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.admin-textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
    resize: vertical;
    min-height: 100px;
    line-height: 1.8;
}
.admin-textarea::placeholder { color: #333; }

@media screen and (max-width: 768px) {
    .hub-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   SEO FIELDS
   ═══════════════════════════════════════ */

.seo-field {
    margin-bottom: 14px;
}

.seo-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text4);
    font-weight: 600;
    margin-bottom: 5px;
}

.seo-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.seo-input-row input,
.seo-input-row textarea {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
}

.seo-input-row textarea {
    resize: vertical;
    min-height: 50px;
}

.seo-input-row .btn-sm {
    flex-shrink: 0;
    height: 38px;
}

.seo-counter {
    font-size: 10px;
    color: var(--text4);
    margin-top: 4px;
    text-align: right;
}