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

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
    --font: 'Plus Jakarta Sans', sans-serif;

    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(59, 130, 246, .15);

    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --orange: #f97316;

    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --text: #0f172a;
    --muted: #64748b;
    --subtle: #94a3b8;

    --sidebar-w: 270px;
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 32px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow: 0 4px 12px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, .20);

    --trans: 180ms ease;
}

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

html,
body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--body-bg);
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ── SCROLLBAR ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ── LAYOUT ────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 100;
}

.sidebar-brand {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-info {
    margin-top: .75rem;
}

.brand-name {
    color: #f1f5f9;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.2;
}

.brand-role {
    color: #3b82f6;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 1rem;
}

.nav-label {
    color: #475569;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 0 .5rem;
    margin: 1.25rem 0 .5rem;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1rem;
    border-radius: 10px;
    color: #94a3b8;
    font-size: .85rem;
    font-weight: 600;
    transition: var(--trans);
    position: relative;
    margin-bottom: .2rem;
}

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

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.nav-link.active {
    background: rgba(59, 130, 246, .15);
    color: #60a5fa;
    font-weight: 700;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-link.orange {
    color: #fb923c;
}

.nav-link.orange.active,
.nav-link.orange:hover {
    background: rgba(249, 115, 22, .12);
    color: #fb923c;
}

.nav-link.green {
    color: #34d399;
}

.nav-link.green.active,
.nav-link.green:hover {
    background: rgba(16, 185, 129, .12);
    color: #34d399;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-stat {
    background: rgba(59, 130, 246, .1);
    border: 1px solid rgba(59, 130, 246, .2);
    border-radius: 12px;
    padding: .85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}

.sidebar-stat-label {
    color: #60a5fa;
    font-size: .72rem;
    font-weight: 700;
}

.sidebar-stat-value {
    color: #93c5fd;
    font-size: 1.2rem;
    font-weight: 900;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .65rem 1rem;
    border-radius: 10px;
    color: #f87171;
    font-size: .78rem;
    font-weight: 700;
    transition: var(--trans);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, .1);
}

/* ── MAIN CONTENT ──────────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── TOP BAR ───────────────────────────────────────────────────── */
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.topbar-sub {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .75rem .4rem .4rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: var(--trans);
}

.user-chip:hover {
    background: var(--body-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
}

.user-chip-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
}

/* ── PAGE CONTENT ──────────────────────────────────────────────── */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* ── PAGE HEADER ───────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-header-text h1 {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.1;
}

.page-header-text p {
    color: var(--muted);
    margin-top: .35rem;
    font-size: .9rem;
}

/* ── CARDS ─────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── STAT CARDS ─────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 var(--r-lg) 0 80px;
    opacity: .06;
}

.stat-card.blue::after {
    background: var(--primary);
}

.stat-card.green::after {
    background: var(--success);
}

.stat-card.orange::after {
    background: var(--orange);
}

.stat-card.purple::after {
    background: var(--purple);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-card.blue .stat-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card.green .stat-icon {
    background: #ecfdf5;
    color: var(--success);
}

.stat-card.orange .stat-icon {
    background: #fff7ed;
    color: var(--orange);
}

.stat-card.purple .stat-icon {
    background: #f5f3ff;
    color: var(--purple);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stat-card.blue .stat-value {
    color: var(--primary);
}

.stat-card.green .stat-value {
    color: var(--success);
}

.stat-card.orange .stat-value {
    color: var(--orange);
}

.stat-card.purple .stat-value {
    color: var(--purple);
}

.stat-label {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 600;
}

/* ── GRID LAYOUTS ───────────────────────────────────────────────── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.25rem;
}

.grid-dash {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ── CLIENT CARD ────────────────────────────────────────────────── */
.client-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--trans);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
}

.client-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow);
    transform: translateY(-2px);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
}

.client-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.client-phone {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: .25rem;
}

.client-meta {
    font-size: .75rem;
    color: var(--muted);
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.client-actions {
    display: flex;
    gap: .5rem;
}

/* ── PROPERTY CARD ──────────────────────────────────────────────── */
.prop-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--trans);
    display: flex;
    flex-direction: column;
}

.prop-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.prop-card-image {
    height: 140px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 2.5rem;
    position: relative;
}

.prop-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.prop-title {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: .5rem;
    line-height: 1.3;
}

.prop-price {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--success);
    margin-bottom: 1rem;
}

.prop-meta {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: auto;
}

.prop-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
}

/* ── FSBO CARD ──────────────────────────────────────────────────── */
.fsbo-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--trans);
    flex-wrap: wrap;
}

.fsbo-card:hover {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .1);
}

.fsbo-card-info {
    flex: 1;
}

.fsbo-no {
    font-size: .7rem;
    color: var(--orange);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.fsbo-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.fsbo-note {
    font-size: .8rem;
    color: var(--muted);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fsbo-right {
    text-align: right;
}

.fsbo-date {
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
}

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 700;
    transition: var(--trans);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-dark {
    background: var(--sidebar);
    color: #fff;
}

.btn-dark:hover {
    background: #1e293b;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-orange {
    background: var(--orange);
    color: #fff;
}

.btn-orange:hover {
    background: #ea580c;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--muted);
}

.btn-outline:hover {
    border-color: var(--border-dark);
    color: var(--text);
    background: var(--body-bg);
}

.btn-ghost {
    background: var(--body-bg);
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--border);
    color: var(--text);
}

.btn-danger-ghost {
    background: #fef2f2;
    color: var(--danger);
}

.btn-danger-ghost:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: .4rem .85rem;
    font-size: .75rem;
    border-radius: 8px;
}

.btn-lg {
    padding: .9rem 2rem;
    font-size: .95rem;
    border-radius: 14px;
}

.btn-full {
    width: 100%;
}

/* ── FORMS ──────────────────────────────────────────────────────── */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.form-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    gap: 1.25rem;
}

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

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

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

label.form-label {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .4rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: .75rem 1rem;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    transition: var(--trans);
    outline: none;
    font-family: var(--font);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-input.money {
    color: var(--success);
    font-weight: 700;
}

.form-input.link-input {
    color: var(--primary);
}

/* ── TABLE ──────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: .85rem 1.25rem;
    text-align: left;
    font-size: .68rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: var(--trans);
    border-bottom: 1px solid #f1f5f9;
}

tbody tr:last-child {
    border: none;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody td {
    padding: 1rem 1.25rem;
    font-size: .85rem;
    font-weight: 500;
}

/* ── BADGES ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .25rem .7rem;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.badge-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-indigo {
    background: #eef2ff;
    color: #4338ca;
}

.badge-purple {
    background: #f5f3ff;
    color: #6d28d9;
}

.badge-orange {
    background: #fff7ed;
    color: #c2410c;
}

.badge-yellow {
    background: #fffbeb;
    color: #92400e;
}

.badge-green {
    background: #ecfdf5;
    color: #065f46;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

.badge-red {
    background: #fef2f2;
    color: #991b1b;
}

/* ── STARS ──────────────────────────────────────────────────────── */
.stars {
    color: #fbbf24;
    font-size: 1rem;
    letter-spacing: 1px;
}

/* ── TASK ITEM ──────────────────────────────────────────────────── */
.task-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--trans);
}

.task-item:hover {
    box-shadow: var(--shadow);
}

.task-item.done {
    opacity: .55;
}

.task-item.done .task-title {
    text-decoration: line-through;
}

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--trans);
}

.task-check.checked {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.task-title {
    font-size: .875rem;
    font-weight: 600;
    flex: 1;
}

.task-date {
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
}

.priority-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.high {
    background: var(--danger);
}

.priority-dot.normal {
    background: var(--primary);
}

.priority-dot.low {
    background: var(--subtle);
}

/* ── SEARCH BAR ─────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 1rem;
    transition: var(--trans);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar i {
    color: var(--subtle);
    font-size: .85rem;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    padding: .7rem 0;
    font-family: var(--font);
    font-size: .85rem;
    color: var(--text);
    width: 220px;
}

.search-bar input::placeholder {
    color: var(--subtle);
}

/* ── FILTER TABS ────────────────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: .3rem;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .25rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: .45rem 1rem;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    transition: var(--trans);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
    text-decoration: none;
}

.filter-tab:hover {
    background: var(--card-bg);
    color: var(--text);
}

.filter-tab.active {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ── FLASH ──────────────────────────────────────────────────────── */
.flash {
    padding: .85rem 1.25rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.flash-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--trans);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--r-xl);
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(.95);
    transition: var(--trans);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 900;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: var(--trans);
    cursor: pointer;
    border: none;
    font-family: var(--font);
    font-size: .9rem;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

/* ── TOP PANEL (client form header) ─────────────────────────────── */
.client-top-panel {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: var(--r-xl);
    padding: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.ctp-label {
    font-size: .65rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: .5rem;
}

/* ── STARS INPUT ────────────────────────────────────────────────── */
.star-input {
    display: flex;
    gap: .25rem;
}

.star-input i {
    font-size: 1.5rem;
    color: #fbbf24;
    cursor: pointer;
    transition: var(--trans);
}

.star-input i:hover,
.star-input i.on {
    color: #f59e0b;
}

.star-input i.off {
    color: #334155;
}

/* ── LOGIN PAGE ─────────────────────────────────────────────────── */
.login-bg {
    min-height: 100vh;
    background: #060e1f;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(59, 130, 246, .12);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, .10);
    bottom: -100px;
    left: -100px;
}

.login-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 28px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(20px);
    box-shadow: 0 40px 80px rgba(0, 0, 0, .6);
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
    color: #fff;
    box-shadow: 0 10px 40px rgba(59, 130, 246, .4);
}

.login-title {
    color: #f1f5f9;
    font-size: 1.75rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: .4rem;
}

.login-subtitle {
    color: #475569;
    font-size: .85rem;
    text-align: center;
    font-style: italic;
    margin-bottom: 2.5rem;
}

.login-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.login-input-wrap i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-size: .9rem;
    pointer-events: none;
}

.login-input {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1.5px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: .9rem 1rem .9rem 2.8rem;
    color: #f1f5f9;
    font-size: .95rem;
    font-family: var(--font);
    outline: none;
    transition: var(--trans);
}

.login-input:focus {
    border-color: var(--primary);
    background: rgba(59, 130, 246, .08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
}

.login-input::placeholder {
    color: #334155;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: .95rem;
    font-weight: 800;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--trans);
    margin-top: .5rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    box-shadow: 0 6px 20px rgba(59, 130, 246, .4);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, .5);
}

.login-btn:active {
    transform: scale(.98);
}

.login-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 10px;
    color: #f87171;
    padding: .75rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

/* ── PAGINATION ─────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.page-btn {
    padding: .5rem .85rem;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    transition: var(--trans);
    color: var(--muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: var(--font);
    text-decoration: none;
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── EMPTY STATE ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: .3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .5rem;
}

.empty-state p {
    font-size: .85rem;
}

/* ── INQUIRY/VIEWING ITEMS ──────────────────────────────────────── */
.inq-item {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .82rem;
    margin-bottom: .5rem;
}

.view-item {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .82rem;
    margin-bottom: .5rem;
}

/* ── DIVIDER ────────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .form-grid-4,
    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-dash {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 1rem;
    }

    .topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 600px) {

    .form-grid-3,
    .form-grid-2,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── ADMIN BADGE ────────────────────────────────────────────────── */
.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-broker {
    background: #eff6ff;
    color: #1e40af;
}

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-content>* {
    animation: fadeIn .25s ease;
}