/* ═════════════════════════════════════════════════
   NESTORA Design System — v1.1
   Rental & Real Estate Portal
   ═════════════════════════════════════════════════ */

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

:root {
    --navy: #0C1D2E;
    --navy-light: #132F46;
    --blue: #1A6FB5;
    --blue-hover: #15609E;
    --blue-light: rgba(26,111,181,0.08);
    --teal: #0D9488;
    --amber: #D97706;
    --bg: #F3F6F9;
    --card: #FFFFFF;
    --border: #E1E7ED;
    --text: #1A2332;
    --text-secondary: #5A6B7F;
    --muted: #8B9AB0;
    --error: #DC2626;
    --error-light: rgba(220,38,38,0.06);
    --success: #059669;
    --success-light: rgba(5,150,105,0.06);
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 2px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ══════════════════════════════════
   AUTH LAYOUT (Login/Register pages)
   ══════════════════════════════════ */

.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-brand-panel {
    flex: 0 0 45%;
    background: linear-gradient(160deg, var(--navy) 0%, #0E3A5C 60%, #145A8A 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26,111,181,0.15), transparent 70%);
    top: -100px;
    right: -200px;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13,148,136,0.1), transparent 70%);
    bottom: -80px;
    left: -100px;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.auth-brand-logo span {
    color: var(--amber);
}

.auth-brand-tagline {
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    line-height: 1.5;
    max-width: 380px;
    margin-bottom: 40px;
}

.auth-brand-features {
    list-style: none;
}

.auth-brand-features li {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-features li .feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: var(--card);
    overflow-y: auto;
}

.auth-form-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

.auth-form-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.auth-form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ══════════════════
   FORM COMPONENTS
   ══════════════════ */

.form-row { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.form-group { flex: 1 1 100%; }
.form-group.half { flex: 1 1 calc(50% - 6px); min-width: 160px; }

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

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

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.form-input,
.form-select {
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-size: 14px;
    color: var(--text);
    background: var(--card);
    font-family: var(--font);
    transition: border var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
}

.form-input::placeholder { color: var(--muted); }
.form-input.has-icon { padding-left: 44px; }
.form-input.input-validation-error { border-color: var(--error); }
.form-input.input-validation-error:focus { box-shadow: 0 0 0 3px var(--error-light); }

.form-select {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B9AB0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-textarea {
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-size: 14px;
    color: var(--text);
    background: var(--card);
    font-family: var(--font);
    transition: border var(--transition);
    outline: none;
    resize: vertical;
    min-height: 80px;
}

.form-textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
}

/* Validation */
.field-validation-error,
.text-danger {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    display: block;
}

.validation-summary-errors ul {
    list-style: none;
    background: var(--error-light);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.validation-summary-errors li {
    font-size: 13px;
    color: var(--error);
    padding: 2px 0;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.form-check input[type="checkbox"] { display: none; }

.check-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-top: 1px;
}

.form-check input:checked + .check-box {
    background: var(--blue);
    border-color: var(--blue);
}

.form-check input:checked + .check-box::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ══════════════════
   BUTTONS
   ══════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: var(--font);
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,111,181,0.25);
}
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 14px rgba(26,111,181,0.3); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

.btn-full { width: 100%; }

.btn-social {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font);
    transition: all var(--transition);
    min-width: 0;
}

.btn-social:hover { border-color: var(--blue); background: var(--blue-light); }

/* ══════════════════
   DIVIDER
   ══════════════════ */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    font-weight: 500;
}

/* ══════════════════
   OTP INPUT
   ══════════════════ */

.otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0 20px;
}

.otp-input {
    width: 50px;
    height: 58px;
    border-radius: 12px;
    border: 2px solid var(--border);
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    outline: none;
    font-family: var(--font);
    transition: border var(--transition);
}

.otp-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

/* ══════════════════
   PASSWORD STRENGTH
   ══════════════════ */

.pw-meter {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: -6px 0 14px;
}

.pw-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #E2E8F0;
    transition: background var(--transition);
}

.pw-bar.filled-green { background: var(--success); }
.pw-bar.filled-amber { background: var(--amber); }

.pw-meter-label { font-size: 11px; font-weight: 600; margin-left: 8px; }

/* ══════════════════
   ALERTS
   ══════════════════ */

.alert {
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.12); }
.alert-warning { background: rgba(217,119,6,0.06); color: var(--amber); border: 1px solid rgba(217,119,6,0.12); }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(26,111,181,0.12); }

/* ══════════════════════════════
   DASHBOARD LAYOUT (Post-Login)
   ══════════════════════════════ */

.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--navy);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-logo span { color: var(--amber); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.nav-section-label {
    padding: 16px 22px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8);
}

.nav-link.active {
    background: rgba(26,111,181,0.2);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--amber);
}

.nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--amber);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

/* Main Content */
.main-area {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    color: var(--navy);
}

.topbar-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-greeting { font-size: 13px; color: var(--text-secondary); }
.topbar-greeting strong { color: var(--text); }

/* Content Area */
.content-area { padding: 28px 32px 40px; flex: 1; }

/* ══════════════════
   DASHBOARD CARDS
   ══════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.5px;
    line-height: 1;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card-trend {
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--amber); }

/* Activity Feed */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
}

.activity-feed {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: #FAFBFC; }

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 14px; font-weight: 600; color: var(--text); }
.activity-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.activity-time { font-size: 12px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.quick-action-btn .qa-icon { font-size: 16px; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-blue { background: var(--blue-light); color: var(--blue); }

/* ══════════════════
   RESPONSIVE
   ══════════════════ */

@media (max-width: 900px) {
    .auth-brand-panel { display: none; }
    .auth-form-panel { padding: 40px 24px; }

    .sidebar { transform: translateX(-260px); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.2); }

    .main-area { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .content-area { padding: 20px 16px 32px; }
    .topbar { padding: 12px 16px; }

    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card-value { font-size: 22px; }
}

@media (max-width: 480px) {
    .form-group.half { flex: 1 1 100%; }
    .otp-input { width: 42px; height: 50px; font-size: 20px; }
    .auth-form-panel { padding: 32px 20px; }
    .auth-form-title { font-size: 22px; }
}
