/* PhotoGridStudio.app - Admin Dashboard Styles */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --admin-bg: #090c14;
    --admin-surface: #101624;
    --admin-card: rgba(22, 30, 48, 0.7);
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-primary: #38bdf8;
    --admin-accent: #818cf8;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

[data-theme="light"] {
    --admin-bg: #f8fafc;
    --admin-surface: #ffffff;
    --admin-card: #ffffff;
    --admin-border: rgba(15, 23, 42, 0.08);
    --admin-primary: #0284c7;
    --admin-accent: #6366f1;
    --admin-success: #059669;
    --admin-warning: #d97706;
    --admin-danger: #dc2626;
    --text-primary: #0f172a;
    --text-secondary: #475569;
}

[data-theme="light"] body {
    background: var(--admin-bg);
    color: var(--text-primary);
}

[data-theme="light"] .kpi-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .table-card {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .data-table th {
    background: #f1f5f9;
    color: #475569;
    border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .data-table td {
    border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .data-table tr:hover {
    background: rgba(2, 132, 199, 0.04);
}

[data-theme="light"] .modal-content {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
    color: #0f172a;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
    background-color: #f8fafc;
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
    border-color: var(--admin-primary);
    background-color: #ffffff;
}

[data-theme="light"] .device-bar-bg {
    background: #e2e8f0;
}

[data-theme="light"] .seo-preview-box {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .aeo-preview-box {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .coupon-tag {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .copy-btn {
    color: #6366f1;
}

[data-theme="light"] .copy-btn:hover {
    color: #4338ca;
    background: rgba(99, 102, 241, 0.1);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--admin-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-surface);
    border-right: 1px solid var(--admin-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--admin-primary);
}

.admin-main {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.kpi-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-val {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.kpi-sub {
    font-size: 12px;
    color: var(--admin-primary);
}

/* CARDS CON TABLAS Y DETALLES */
.content-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* TABLAS ESTILIZADAS */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--admin-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* BADGES */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--admin-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--admin-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--admin-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(56, 189, 248, 0.15); color: var(--admin-primary); border: 1px solid rgba(56, 189, 248, 0.3); }

/* BARRAS DE PROGRESO DE TELEMETRÍA */
.progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-accent));
    border-radius: inherit;
    transition: width 0.6s ease;
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary), #0284c7);
    color: #04101d;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--admin-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 7px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   MODAL OVERLAY & DIALOG
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 8, 16, 0.82);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: #101624;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
    animation: modalFadeIn 0.22s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--admin-border);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--admin-border);
    background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-select {
    background-color: #161e30;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.form-hint {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

/* CODE BADGE & COPY */
.code-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(129, 140, 248, 0.15);
    color: #c7d2fe;
    border: 1px solid rgba(129, 140, 248, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #a5b4fc;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}
.copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* AVATAR */
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #38bdf8;
    flex-shrink: 0;
}

