/* =========================================
   TERZO TEMPO VILLAGE - PERSONAL AREA UI
   Clean, linear, professional, lightweight
========================================= */

/* =========================================
   ROOT
========================================= */
:root {
    --bg: #f5f7fb;
    --bg-soft: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #ffffff;

    --text: #172033;
    --text-soft: #5f6b7c;
    --text-faint: #8793a5;

    --border: #e6ebf2;
    --border-strong: #d8e0ea;

    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-soft: #e8f0ff;

    --success: #15803d;
    --success-soft: #e8f7ed;

    --warning: #b45309;
    --warning-soft: #fff4e5;

    --danger: #b91c1c;
    --danger-soft: #fdecec;

    --info: #0f766e;
    --info-soft: #e8f8f6;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 18px 42px rgba(16, 24, 40, 0.08);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --sidebar-width: 272px;
    --content-max: 1440px;
    --transition: 0.2s ease;
}

/* =========================================
   RESET
========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fc 0%, #f1f5f9 100%);
}

body {
    line-height: 1.5;
}

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

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.18);
    outline-offset: 2px;
}

/* =========================================
   ERROR PAGE
========================================= */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #f7f9fc 0%, #f1f5f9 100%);
}

.error-page__content {
    width: 100%;
    max-width: 900px;
}

.error-page .card-actions {
    justify-content: center;
    margin-top: 20px;
}

/* =========================================
   APP LAYOUT
========================================= */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.app-shell--single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.app-main {
    width: 100%;
    max-width: var(--content-max);
    padding: 32px;
}

.app-shell--single .app-main {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* =========================================
   SIDEBAR
========================================= */
.app-sidebar {
    min-width: 0;
}

.sidebar-shell {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.brand-copy strong {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
}

.brand-copy small {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sidebar-label,
.sidebar-group-title {
    margin: 2px 10px 0;
    color: var(--text-faint);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    padding-bottom: 8px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(23, 32, 51, 0.18);
    border-radius: 999px;
}

.sidebar-group {
    display: grid;
    gap: 6px;
}

.sidebar-group + .sidebar-group {
    margin-top: 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: var(--text);
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.sidebar-nav a:hover {
    background: var(--surface-soft);
    border-color: var(--border);
}

.sidebar-nav a.active {
    background: var(--primary-soft);
    border-color: #cfe0ff;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-nav a span:first-child {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: grid;
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
}

.logout-form {
    margin: 0;
    width: 100%;
}

.logout-link,
.sidebar-home-link,
.complete-profile-logout,
.complete-profile-home {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.logout-link:hover,
.sidebar-home-link:hover,
.complete-profile-logout:hover,
.complete-profile-home:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.sidebar-home-link,
.complete-profile-home {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #cfe0ff;
    font-weight: 700;
}

.sidebar-home-link:hover,
.complete-profile-home:hover {
    background: #dfeaff;
    border-color: #bcd3ff;
}

.complete-profile-actions {
    display: grid;
    gap: 8px;
    min-width: 190px;
}

.complete-profile-actions .logout-form {
    width: 100%;
}

/* =========================================
   TYPOGRAPHY / HEADERS
========================================= */
.page-header,
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow,
.dashboard-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.page-header h1,
.topbar h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text);
}

.lead {
    margin: 0;
    max-width: 760px;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.lead-small {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.text-link {
    color: var(--primary);
    font-weight: 600;
    transition: color var(--transition);
}

.text-link:hover {
    color: var(--primary-hover);
}

.text-muted {
    color: #667085;
}

/* =========================================
   LAYOUT BLOCKS
========================================= */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.dashboard-layout__main,
.dashboard-layout__side,
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-head.compact h2 {
    font-size: 1.05rem;
}

.section-head h2 {
    margin: 0 0 4px;
    font-size: 1.28rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-head p {
    margin: 0;
    color: var(--text-soft);
}

/* =========================================
   CARD
========================================= */
.card,
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card {
    padding: 22px;
}

.form-card,
.conversation-card,
.composer-card {
    padding: 24px;
}

/* =========================================
   BUTTONS / ACTIONS
========================================= */
.card-actions,
.form-actions,
.table-inline-actions,
.composer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-actions-reset {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn:hover {
    box-shadow: var(--shadow-sm);
}

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

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

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

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

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

.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.9rem;
}

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

.btn-danger:hover {
    background: #991b1b;
    border-color: #991b1b;
}

/* =========================================
   CHIPS / STATUS
========================================= */
.chip,
.table-status,
.booking-status,
.booking-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.chip-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.chip-green {
    background: var(--success-soft);
    color: var(--success);
}

.chip-gold {
    background: var(--warning-soft);
    color: var(--warning);
}

.chip-pink {
    background: #fce7f3;
    color: #be185d;
}

.chip-soft {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.booking-chip {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.booking-status,
.status-confirmed,
.status-completed {
    background: var(--success-soft);
    color: var(--success);
}

.status-pending {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-cancelled {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-ok {
    color: var(--success);
    font-weight: 700;
}

.status-ko {
    color: var(--danger);
    font-weight: 700;
}

/* =========================================
   STATS
========================================= */
.stats-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

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

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

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
}

.stat-card--glow {
    border-color: #d9e6ff;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 1.15rem;
}

.stat-card__label {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
}

.stat-card__value {
    margin: 0;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text);
}

.stat-card small {
    color: var(--text-faint);
    line-height: 1.55;
}

/* =========================================
   FORMS
========================================= */
.form-grid {
    display: grid;
    gap: 16px;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-field textarea {
    min-height: 130px;
    resize: vertical;
    padding-top: 12px;
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.filter-bar input::placeholder {
    color: var(--text-faint);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #b8d1ff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

.form-field select,
.filter-bar select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #7b8798 50%),
        linear-gradient(135deg, #7b8798 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-field select option {
    color: var(--text);
    background: #fff;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.9rem;
}

/* =========================================
   ALERTS
========================================= */
.alert-card {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.alert-card-success {
    background: var(--success-soft);
    border-color: #cdeed7;
    color: var(--success);
    font-weight: 700;
}

.alert-card-danger {
    background: var(--danger-soft);
    border-color: #f3c7c7;
    color: var(--danger);
    font-weight: 700;
}

/* =========================================
   EMPTY STATES
========================================= */
.empty-state {
    text-align: center;
    padding: 40px 24px;
}

.empty-state-compact {
    padding: 28px 20px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: var(--text);
}

.empty-state p,
.empty-inline-state {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.empty-inline-state {
    padding: 18px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
}

/* =========================================
   DASHBOARD CARDS
========================================= */
.booking-spotlight-grid,
.quick-actions-grid,
.community-grid,
.stack-list,
.profile-grid,
.chat-grid,
.stack-list-wide {
    display: grid;
    gap: 16px;
}

.stack-list-wide {
    gap: 18px;
}

.quick-actions-grid-advanced {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.community-grid-advanced,
.profile-grid-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-grid-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-spotlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-card,
.request-card,
.chat-preview-card,
.notification-card,
.booking-card {
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.quick-action-card:hover,
.request-card:hover,
.chat-preview-card:hover,
.notification-card:hover,
.booking-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
}

.qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 1.15rem;
}

.quick-action-card h3,
.request-card h3,
.booking-card h3,
.chat-preview-card h3,
.notification-card h3 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.quick-action-card p,
.request-message,
.notification-body,
.chat-last-message,
.booking-meta,
.map-selection-card__category,
.map-selection-card__description {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

/* =========================================
   BOOKING CARD
========================================= */
.booking-card__top,
.request-card__top,
.chat-preview-card__top,
.notification-card__head,
.conversation-topbar,
.availability-panel__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.booking-meta {
    margin-top: 8px;
}

.booking-card .card-actions {
    margin-top: 16px;
}

/* =========================================
   COMMUNITY
========================================= */
.request-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.request-meta-pill {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.request-meta-pill span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-faint);
    font-size: 0.82rem;
}

.request-meta-pill strong {
    font-size: 0.96rem;
    color: var(--text);
}

.request-footer-row {
    margin-top: 14px;
}

.meta {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.9rem;
}

/* =========================================
   TABLES
========================================= */
.table-card {
    overflow: hidden;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.app-table thead th {
    text-align: left;
    padding: 16px 18px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-faint);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.app-table tbody td {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.app-table tbody tr:last-child td {
    border-bottom: none;
}

.app-table tbody tr:hover {
    background: #fbfcfe;
}

.table-inline-actions {
    align-items: center;
}

.table-inline-actions form {
    margin: 0;
}

/* =========================================
   FILTER / TABS BAR
========================================= */
.filter-bar,
.tabs-bar {
    margin-bottom: 8px;
}

.filter-bar__row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
    gap: 12px;
    align-items: center;
}

.filter-bar__row--wide {
    grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
    align-items: end;
}

.tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    font-weight: 600;
}

.tab-pill.active,
.tab-pill:hover {
    background: var(--primary-soft);
    border-color: #cfe0ff;
    color: var(--primary);
}

/* =========================================
   CHAT
========================================= */
.chat-preview-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 220px;
}

.chat-preview-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar,
.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    border: 1px solid #cfe0ff;
}

.chat-avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 1.4rem;
}

.chat-subtitle {
    margin: 4px 0 0;
    color: var(--text-faint);
    font-size: 0.9rem;
}

.chat-unread-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.chat-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.conversation-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 20px;
}

.conversation-card--large {
    min-height: 640px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 6px;
}

.message-row {
    display: flex;
}

.message-row.mine {
    justify-content: flex-end;
}

.message-row.other {
    justify-content: flex-start;
}

.message-bubble {
    max-width: min(78%, 620px);
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.message-row.mine .message-bubble {
    background: var(--primary-soft);
    border-color: #cfe0ff;
}

.message-author {
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-soft);
}

.message-content {
    color: var(--text);
    line-height: 1.65;
    word-break: break-word;
}

.conversation-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-widget,
.composer-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.composer-card--sticky {
    position: sticky;
    top: 24px;
}

.profile-summary-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.quick-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-mini-action {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    transition: background var(--transition), border-color var(--transition);
}

.quick-mini-action:hover {
    background: #f3f6fb;
    border-color: var(--border-strong);
}

/* =========================================
   PROFILE
========================================= */
.profile-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.profile-details-card h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.profile-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-detail-row span {
    color: var(--text-soft);
}

.profile-detail-row strong {
    color: var(--text);
    text-align: right;
}

/* =========================================
   NOTIFICATIONS
========================================= */
.stack-list {
    grid-template-columns: 1fr;
}

.notification-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 1.1rem;
}

/* =========================================
   SPORTS MAP
========================================= */
.sports-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
    gap: 20px;
}

.sports-map-card {
    padding: 16px;
}

.fields-interactive-map {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #edf2f7;
    border: 1px solid var(--border);
}

.fields-interactive-map__image {
    width: 100%;
    height: auto;
    display: block;
}

.fields-interactive-map__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-area {
    cursor: pointer;
    outline: none;
}

.map-area polygon {
    fill: rgba(29, 78, 216, 0.18);
    stroke: rgba(29, 78, 216, 0.82);
    stroke-width: 2;
    transition: fill var(--transition), stroke var(--transition);
}

.map-area:hover polygon,
.map-area:focus polygon {
    fill: rgba(29, 78, 216, 0.28);
}

.map-area.is-active polygon {
    fill: rgba(21, 128, 61, 0.26);
    stroke: rgba(21, 128, 61, 0.95);
}

.sports-map-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-selection-card h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.map-selection-card__category {
    font-weight: 600;
    margin-bottom: 6px;
}

.map-selection-card__description {
    margin-bottom: 16px;
}

.map-legend-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    letter-spacing: 0;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-soft);
    line-height: 1.6;
}

.availability-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.date-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.date-tab {
    min-width: 82px;
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.date-tab:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.date-tab.is-active {
    background: var(--primary-soft);
    border-color: #cfe0ff;
    color: var(--primary);
}

.date-tab__weekday {
    font-size: 0.82rem;
    font-weight: 700;
}

.date-tab__day {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.selected-date-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.selected-day-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.slot-row__main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-row__time {
    font-weight: 700;
    color: var(--text);
}

.slot-row__price-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.slot-price {
    font-weight: 700;
    color: var(--text-soft);
}

.slot-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.slot-chip--free {
    background: var(--success-soft);
    color: var(--success);
}

.slot-chip--waiting {
    background: var(--warning-soft);
    color: var(--warning);
}

.slot-chip--blocked {
    background: var(--danger-soft);
    color: var(--danger);
}

/* =========================================
   FRIENDS
========================================= */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.friends-grid--wide {
    margin-top: 24px;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.friend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.friend-row:last-child {
    border-bottom: 0;
}

.friend-row--checkbox {
    cursor: pointer;
}

.invite-link-box input {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: 12px 14px;
}

/* =========================================
   STAFF AREA
========================================= */
.staff-dashboard-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
}

.sidebar-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border);
    border-radius: 999px;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 1400px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .stats-grid-4,
    .quick-actions-grid-advanced,
    .booking-spotlight-grid,
    .chat-grid-advanced,
    .community-grid-advanced,
    .profile-grid-advanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .conversation-layout,
    .sports-map-layout {
        grid-template-columns: 1fr;
    }

    .composer-card--sticky {
        position: static;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar-shell {
        position: relative;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }

    .sidebar-section,
    .sidebar-nav {
        overflow: visible;
        min-height: auto;
    }

    .form-grid-3,
    .request-meta-grid,
    .filter-bar__row,
    .filter-bar__row--wide,
    .staff-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 768px) {
    .app-main {
        padding: 18px;
    }

    .page-header,
    .topbar,
    .section-head,
    .booking-card__top,
    .request-card__top,
    .notification-card__head,
    .conversation-topbar,
    .availability-panel__top {
        flex-direction: column;
    }

    .stats-grid-4,
    .stats-grid-6,
    .quick-actions-grid-advanced,
    .booking-spotlight-grid,
    .chat-grid-advanced,
    .community-grid-advanced,
    .profile-grid-advanced {
        grid-template-columns: 1fr;
    }

    .card-actions,
    .form-actions,
    .table-inline-actions,
    .composer-toolbar,
    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .logout-link,
    .sidebar-home-link,
    .complete-profile-logout,
    .complete-profile-home {
        width: 100%;
    }

    .complete-profile-actions {
        width: 100%;
        min-width: 0;
    }

    .app-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .slot-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .slot-row__actions {
        width: 100%;
    }

    .slot-row__actions .btn {
        width: 100%;
    }

    .profile-detail-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-detail-row strong {
        text-align: left;
    }
}
