/* =====================================================
   Sistema de diseño — Inmobiliaria
   Paleta corporativa: navy profundo + acento teal.
   ===================================================== */

:root {
    --ink: #0f172a;
    --ink-soft: #64748b;
    --surface: #ffffff;
    --bg: #f3f5fa;
    --border: #e5e9f2;
    --accent: #14b8a6;
    --accent-dark: #0d9488;
    --sidebar-bg: #0b1120;
    --sidebar-bg-2: #131c2e;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, .08);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, .14);
    --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, .font-bold, .sidebar-brand-title, .topbar-title {
    font-family: 'Sora', 'Inter', sans-serif;
    letter-spacing: -0.015em;
}

/* ---------------------------------------------------
   Layout tipo dashboard: sidebar + topbar
   --------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 14px;
    z-index: 40;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    margin-bottom: 18px;
}
.sidebar-brand-mark { font-size: 26px; line-height: 1; }
.sidebar-logo-img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; flex-shrink: 0; }
.auth-hero-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 14px; padding: 8px; margin-bottom: 20px; }
.sidebar-brand-title { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar-brand-sub { font-size: 11px; color: #8b98ad; margin-top: 2px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    font-size: 13.5px; font-weight: 500; color: #97a3b8;
    border-left: 2px solid transparent;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link svg { opacity: .8; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.is-active {
    background: rgba(20, 184, 166, .14);
    color: #fff;
    border-left-color: var(--accent);
}
.sidebar-link.is-active svg { color: var(--accent); opacity: 1; }

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-avatar {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #04211d; font-size: 14px;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #8b98ad; }
.sidebar-logout { color: #97a3b8; padding: 6px; border-radius: 8px; transition: .15s; flex-shrink: 0; }
.sidebar-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px; flex-shrink: 0;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 26px;
    position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.sidebar-toggle { display: none; color: var(--ink-soft); }

.content { padding: 26px; flex: 1; }
.auth-main { min-height: 100vh; }

/* ---------------------------------------------------
   Tarjetas, tablas, formularios: pulido corporativo
   sobre las utilidades de Tailwind ya usadas.
   --------------------------------------------------- */
.bg-white.shadow, .bg-white.shadow-lg, .bg-white.rounded-xl.shadow {
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-md) !important;
}
.rounded-xl { border-radius: var(--radius-lg) !important; }

table { border-collapse: separate !important; border-spacing: 0; }
thead th {
    font-size: 11px !important; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-soft) !important; background: #f8fafc !important;
    font-weight: 700 !important;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f8fafc; }
td, th { border-color: var(--border) !important; }

input, select, textarea {
    transition: border-color .15s ease, box-shadow .15s ease;
    border-color: var(--border) !important;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .15) !important;
}

a, button { transition: transform .12s ease, box-shadow .12s ease, background .15s ease; }

a.bg-emerald-600, button.bg-emerald-600, .bg-emerald-600 {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none;
}
a.bg-indigo-600, button.bg-indigo-600, .bg-indigo-600 {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
}
a.bg-slate-800, button.bg-slate-800, .bg-slate-800 {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}
a.bg-red-600, button.bg-red-600 {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}
a.bg-emerald-600:hover, button.bg-emerald-600:hover,
a.bg-indigo-600:hover, button.bg-indigo-600:hover,
a.bg-slate-800:hover, button.bg-slate-800:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

span[class*="rounded"][class*="text-xs"] { font-weight: 600 !important; letter-spacing: .01em; }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ---------------------------------------------------
   Pantallas de acceso (login / registro): split screen
   --------------------------------------------------- */
.auth-split { display: flex; min-height: 100vh; }
.auth-hero {
    flex: 1; position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--sidebar-bg) 0%, #0d3b3a 130%);
    color: #fff; display: flex; flex-direction: column; justify-content: center;
    padding: 64px;
}
.auth-hero::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 15%, rgba(45, 212, 191, .25), transparent 60%);
}
.auth-hero-content { position: relative; z-index: 1; max-width: 440px; }
.auth-hero-mark { font-size: 40px; display: block; margin-bottom: 20px; }
.auth-hero h2 { font-size: 30px; font-weight: 700; line-height: 1.25; margin-bottom: 14px; }
.auth-hero p { color: #b6c2d9; font-size: 15px; line-height: 1.65; }
.auth-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.auth-hero-badge {
    font-size: 12px; font-weight: 600; color: #cbd5e1;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    padding: 6px 12px; border-radius: 999px;
}
.auth-form-side {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 32px; background: #fff;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh;
        transform: translateX(-100%);
    }
    .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-toggle { display: inline-flex; }
    .content { padding: 16px; }
    .auth-hero { display: none; }
}
