* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #e0f2fe, #0f172a);
    color: #0f172a;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Auth */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #dbeafe, #0f172a);
}

.auth-card {
    background: rgba(15, 23, 42, 0.96);
    padding: 2.5rem 2.75rem;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(15,23,42,0.7);
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.logo-area {
    text-align: center;
    margin-bottom: 1.75rem;
}

.logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: radial-gradient(circle at top, #60a5fa, #22c55e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.logo-area h1 {
    margin: 0;
    font-size: 1.6rem;
}

.subtitle {
    margin: 0.25rem 0 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form label {
    font-size: 0.85rem;
    color: #cbd5f5;
}

.form input, .form select {
    padding: 0.55rem 0.7rem;
    border-radius: 0.7rem;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
}

.form input:focus, .form select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.btn {
    border-radius: 999px;
    padding: 0.7rem 1.3rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #22c55e);
    color: white;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: rgba(239,246,255,0.9);
    color: #1f2937;
    border: 1px solid #93c5fd;
}

.btn-secondary:hover {
    background: #dbeafe;
}

.alert {
    padding: 0.6rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    text-align: center;
    color: #9ca3af;
}

/* Layout principal */

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: radial-gradient(circle at top, #eff6ff, #020617);
}

.sidebar {
    background: linear-gradient(180deg, #0f172a, #020617);
    border-right: 1px solid rgba(15, 23, 42, 0.9);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    color: #e5e7eb;
}

.sidebar .logo-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sidebar .logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at top, #60a5fa, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

.sidebar .logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text span:first-child {
    font-size: 0.95rem;
    font-weight: 600;
}

.logo-text span:last-child {
    font-size: 0.75rem;
    color: #9ca3af;
}

.nav-section-title {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    color: #cbd5f5;
}

.nav-item a.active, .nav-item a:hover {
    background: rgba(37,99,235,0.18);
    color: #f9fafb;
}

.nav-icon {
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: #6b7280;
}

.main {
    padding: 1.5rem 1.75rem;
    background: radial-gradient(circle at top, #eff6ff, #020617);
    color: #0f172a;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.main-header h1 {
    margin: 0;
    font-size: 1.3rem;
    color: #0f172a;
}

.main-header p {
    margin: 0.2rem 0 0;
    color: #4b5563;
    font-size: 0.85rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(148,163,184,0.8);
    font-size: 0.85rem;
    color: #111827;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: radial-gradient(circle at top, #60a5fa, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #0f172a;
}

.chip {
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(191,219,254,0.9);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #1d4ed8;
}

/* Cards */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.9rem;
    padding: 1rem;
    border: 1px solid rgba(209, 213, 219, 0.9);
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.card h3 {
    margin: 0;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: #0f172a;
}

.card p {
    margin: 0;
    font-size: 0.8rem;
    color: #4b5563;
}

.card-main-value {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 0.3rem;
    color: #1d4ed8;
}

/* Tabla */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.table th, .table td {
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    background: #eff6ff;
}

.table tr:nth-child(even) {
    background: #f9fafb;
}

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

.table tr:hover {
    background: #e0f2fe;
}

.badge {
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.08);
    color: #b45309;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.25);
    color: #374151;
}

/* Marketplace */

.market-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr);
    gap: 1rem;
}

.map-card {
    height: 420px;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
}

.screen-list {
    max-height: 420px;
    overflow-y: auto;
}

.screen-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.6rem;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #e5e7eb;
}

.screen-thumb {
    width: 90px;
    height: 60px;
    border-radius: 0.5rem;
    background: #e5e7eb;
    overflow: hidden;
}

.screen-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screen-meta h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #111827;
}

.screen-meta p {
    margin: 0.15rem 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.screen-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
    font-size: 0.75rem;
}

.screen-footer .price {
    font-weight: 600;
    color: #1d4ed8;
}

.screen-footer .traffic {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

/* Forms pequeños */

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Utils */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.text-muted { color: #6b7280; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
