/* ============================================================
   KMA PROPIEDADES — ADMIN CSS
   ============================================================ */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-sidebar: #131f35;
    --border: #334155;
    --accent: #f97316;
    --accent-hover: #fb923c;
    --accent-dim: rgba(249, 115, 22, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
    --warning: #f97316;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; }
h1,h2,h3,h4,h5 { line-height: 1.2; }

/* ---------- Admin Layout ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-brand-logo {
    max-height: 38px;
    width: auto;
    height: auto;
    display: block;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-nav-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 8px;
    margin-top: 20px;
}

.sidebar-nav-title:first-child { margin-top: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--error);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Main Content */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.admin-topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

.topbar-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.topbar-breadcrumb strong { color: var(--text-primary); font-weight: 600; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
}

.topbar-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.topbar-btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1100;
}

.topbar-btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #1a1100;
}

/* Content Area */
.admin-content {
    flex: 1;
    padding: 28px 28px 48px;
    max-width: 1400px;
    width: 100%;
}

.admin-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

/* ---------- Stats Cards ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.accent { background: var(--accent-dim); color: var(--accent); }
.stat-card-icon.success { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-card-icon.info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-card-icon.warning { background: rgba(249,115,22,0.15); color: var(--accent); }
.stat-card-icon.danger { background: rgba(239,68,68,0.15); color: #f87171; }

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    display: block;
}

/* ---------- Tables ---------- */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.table-card-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.table-wrapper { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
    color: var(--text-secondary);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr {
    transition: background var(--transition);
}

.admin-table tbody tr:hover {
    background: rgba(255,255,255,0.025);
}

.admin-table .cell-title {
    color: var(--text-primary);
    font-weight: 600;
    max-width: 240px;
}

.admin-table .cell-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table .cell-title a:hover { color: var(--accent); }

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

.cell-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.thumb-sm {
    width: 52px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.thumb-placeholder {
    width: 52px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ---------- Toggle Switch ---------- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 100px;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

.toggle-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* ---------- Forms ---------- */
.admin-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.form-col-full { grid-column: 1 / -1; }

.form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .req { color: var(--error); margin-left: 2px; }

.form-control {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(245,158,11,0.04);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 110px; }

.form-control option { background: var(--bg-secondary); }

.form-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ---------- Image Upload ---------- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: rgba(255,255,255,0.02);
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin: 0 auto 12px;
}

.upload-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.preview-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    background: var(--bg-primary);
}

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

.preview-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239,68,68,0.9);
    border: none;
    border-radius: var(--radius-sm);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background var(--transition);
    padding: 0;
}

.preview-delete:hover { background: var(--error); }

.preview-main-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--accent);
    color: #1a1100;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn-xs { padding: 5px 10px; font-size: 0.78rem; }
.btn-sm { padding: 7px 14px; font-size: 0.84rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

.btn-accent { background: var(--accent); color: #1a1100; font-weight: 700; }
.btn-accent:hover { background: var(--accent-hover); color: #1a1100; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); }

.btn-success { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: var(--success); color: #fff; border-color: var(--success); }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }
.alert-warning { background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.3); color: var(--accent); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-error, .badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-warning { background: rgba(249,115,22,0.15); color: var(--accent); }
.badge-muted { background: rgba(100,116,139,0.15); color: var(--text-muted); }

/* ---------- Search & Filters Bar ---------- */
.toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.toolbar-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.toolbar-search input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition);
}

.toolbar-search input:focus { border-color: var(--accent); }

.toolbar-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    min-width: 140px;
}

.toolbar-select option { background: var(--bg-secondary); }

/* ---------- Message Detail ---------- */
.message-row {
    cursor: pointer;
}

.message-row.unread td:first-child {
    border-left: 3px solid var(--accent);
}

.message-detail-panel {
    display: none;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}

.message-detail-panel.open { display: block; }

.message-detail-inner {
    padding: 20px 24px;
}

.message-detail-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.message-detail-meta strong { color: var(--text-secondary); }

.message-body {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ---------- Login Page ---------- */
.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #0d1c35 100%);
    position: relative;
    overflow: hidden;
}

.admin-login-page::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245,158,11,0.08), transparent 70%);
    border-radius: 50%;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    max-height: 80px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.83rem;
}

.login-card .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.login-card .form-control {
    padding: 12px 16px;
    font-size: 1rem;
}

.login-submit {
    width: 100%;
    padding: 13px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.login-back {
    text-align: center;
    margin-top: 20px;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.login-back a { color: var(--text-secondary); }
.login-back a:hover { color: var(--accent); }

/* ---------- Pagination ---------- */
.admin-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1100;
}

/* ---------- Misc ---------- */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: #34d399; }
.text-danger { color: #f87171; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-100 { width: 100%; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .form-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .admin-content { padding: 16px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-grid-4 { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 28px 20px; }
}

/* ============================================================
   CMS ADDITIONS
   ============================================================ */

/* Rich text editor */
.rte-wrapper { margin-bottom: 4px; }
.rte-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 8px;
    background: var(--bg-tertiary, #0f172a);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}
.rte-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    line-height: 1.4;
}
.rte-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.rte-editor {
    min-height: 150px;
    padding: 12px;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    color: var(--text-primary);
    outline: none;
    line-height: 1.6;
    font-size: 0.9rem;
}
.rte-editor:focus { border-color: var(--accent); }
.rte-editor h2 { font-size: 1.2rem; margin: 10px 0 6px; }
.rte-editor h3 { font-size: 1rem; margin: 8px 0 4px; }
.rte-editor ul, .rte-editor ol { margin-left: 20px; }

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* Valores dynamic list */
.valores-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.valor-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.valor-remove {
    padding: 6px;
    background: none;
    border: 1px solid var(--error, #ef4444);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 22px;
}
.valor-remove:hover { background: rgba(239,68,68,0.15); }

/* Footer address pin */
.footer-address-pin {
    display: inline-block;
    font-size: 0.88rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 4px;
}

/* Footer social links */
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.footer-social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Navbar social icons */
.nav-social-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    transition: all 0.2s;
}
.nav-social-icon:hover { color: var(--accent); background: rgba(245,158,11,0.1); }

/* Form card */
.form-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    padding: 24px;
    margin-bottom: 16px;
}
.form-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}
.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-required { color: var(--error, #ef4444); }
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; }

/* Badges extra */
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-muted   { background: var(--bg-secondary); color: var(--text-muted); }

/* Btn danger */
.btn-danger {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); border-color: #ef4444; }

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md, 12px);
    font-size: 0.9rem;
}
.alert-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981;
}

@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .valor-item { grid-template-columns: 1fr; }
    .valor-remove { margin-top: 0; }
}
