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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-2: #232738;
    --border: #2e3348;
    --text: #e8eaed;
    --text-dim: #8b8fa3;
    --accent: #6c8cff;
    --accent-hover: #8ba4ff;
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.1);
    --orange: #fbbf24;
    --orange-bg: rgba(251, 191, 36, 0.1);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.1);
    --blue: #60a5fa;
    --purple: #a78bfa;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Navigation ──────────────────────────────────── */
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
}
.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
    line-height: 1.1;
}
.nav-brand i { font-size: 20px; }
.nav-logo {
    height: 22px;
    width: auto;
    opacity: 0.9;
}
.nav-brand-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
@media (min-width: 768px) {
    .nav-brand-text { display: block; }
}
@media (max-width: 767px) {
    .nav-logo { display: none; }
    .nav-brand {
        flex-direction: row;
        gap: 0;
    }
    .nav-brand-text {
        font-size: 16px;
        letter-spacing: 2px;
    }
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}
.nav-link.active {
    color: var(--accent);
    background: var(--surface-2);
}
.logout-link { color: var(--red); }
.logout-link:hover { background: var(--red-bg); }

.badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ── Main ────────────────────────────────────────── */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── Cards ───────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header i { color: var(--accent); }
.card-body { padding: 16px 20px; }

/* ── Stats Row ───────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}
.stat-pending .stat-number { color: var(--blue); }
.stat-done .stat-number { color: var(--green); }
.stat-warning .stat-number,
.stat-overdue .stat-number { color: var(--red); }
.stat-upcoming .stat-number { color: var(--purple); }

/* ── Dashboard Grid ──────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.dashboard-section { margin-bottom: 20px; }

/* ── Tasks ───────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}
.task-item:hover { background: var(--surface-2); }
.task-priority { border-left: 3px solid transparent; }
.task-urgent { border-left-color: var(--red); }
.task-high { border-left-color: var(--orange); }
.task-low { border-left-color: var(--blue); }

.task-check-form { flex-shrink: 0; padding-top: 2px; }
.task-check {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 18px;
    padding: 2px;
    transition: color 0.15s;
}
.task-check:hover { color: var(--accent); }
.task-check.checked { color: var(--green); }

.task-content { flex: 1; min-width: 0; cursor: pointer; }
.task-content:hover .task-title { color: var(--accent); }
.task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}
.task-title.done { text-decoration: line-through; color: var(--text-dim); }
.task-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.task-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.task-actions { flex-shrink: 0; display: flex; gap: 4px; }
.task-more { text-align: center; padding: 8px; font-size: 13px; color: var(--text-dim); }

/* ── Tags ────────────────────────────────────────── */
.tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.tag-urgent { background: var(--red-bg); color: var(--red); }
.tag-high { background: var(--orange-bg); color: var(--orange); }
.tag-medium { background: rgba(108, 140, 255, 0.1); color: var(--accent); }
.tag-low { background: rgba(96, 165, 250, 0.1); color: var(--blue); }
.tag-due { background: rgba(139, 143, 163, 0.1); color: var(--text-dim); }
.tag-due.overdue { background: var(--red-bg); color: var(--red); }
.tag-person { background: rgba(167, 139, 250, 0.1); color: var(--purple); }
.tag-status-pending { background: rgba(251, 191, 36, 0.1); color: var(--orange); }
.tag-status-in_progress { background: rgba(96, 165, 250, 0.1); color: var(--blue); }
.tag-status-completed { background: var(--green-bg); color: var(--green); }

/* ── Events ──────────────────────────────────────── */
.events-mini-list { display: flex; flex-direction: column; gap: 8px; }
.event-mini-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.event-mini-item:last-child { border-bottom: none; }
.event-mini-date {
    text-align: center;
    min-width: 40px;
}
.event-mini-day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}
.event-mini-month {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}
.event-mini-info { flex: 1; }
.event-mini-title {
    font-size: 14px;
    font-weight: 500;
}
.event-mini-time {
    font-size: 12px;
    color: var(--text-dim);
}
.calendar-list { display: flex; flex-direction: column; }
.calendar-month-header {
    font-size: 16px;
    font-weight: 700;
    padding: 16px 0 8px;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.calendar-event {
    display: flex;
    gap: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}
.calendar-event:hover { background: var(--surface-2); }
.calendar-event-date {
    text-align: center;
    min-width: 50px;
}
.cal-day {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}
.cal-weekday {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}
.calendar-event-info { flex: 1; }
.calendar-event-title { font-size: 15px; font-weight: 600; }
.calendar-event-details {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}
.calendar-event-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}
.calendar-event-actions { flex-shrink: 0; }
/* Completed items */
.done-list { display: flex; flex-direction: column; gap: 4px; }
.done-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.done-item:last-child { border-bottom: none; }
.done-check { color: var(--green); font-size: 14px; flex-shrink: 0; }
.done-title { flex: 1; }
.done-time { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }

/* ── Team ────────────────────────────────────────── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.team-member-card .card-header {
    padding: 16px;
    gap: 12px;
}
.member-avatar { font-size: 36px; color: var(--accent); flex-shrink: 0; }
.member-info { flex: 1; }
.member-info h3 { font-size: 16px; font-weight: 600; margin: 0; }
.member-role { font-size: 12px; color: var(--text-dim); }
.member-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.member-stats strong { color: var(--text); }
.member-task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 12px;
}

/* ── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dim);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}
textarea.input { resize: vertical; }
select.input { cursor: pointer; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover {
    background: var(--surface);
    border-color: var(--accent);
}
.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s;
}
.btn-icon:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ── Login ───────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.login-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 8px;
}
.login-icon .login-logo {
    max-height: 80px;
    width: auto;
}
.login-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}
.login-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 32px;
    font-weight: 500;
}
.login-form .input {
    margin-bottom: 16px;
    text-align: center;
    font-size: 16px;
}
.login-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 12px;
}

/* ── Flash ───────────────────────────────────────── */
.flash-container {
    margin-bottom: 16px;
}
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}
.flash-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}
.flash-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ── Empty State ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-dim);
}
.empty-state.small { padding: 16px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-form { padding: 20px; }

/* ── Page Header ────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Filter Tabs ──────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    width: fit-content;
}
.filter-tab {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.15s;
}
.filter-tab:hover {
    color: var(--text);
    background: var(--surface-2);
}
.filter-tab.active {
    color: white;
    background: var(--accent);
}

/* ── Completed Separator ─────────────────────── */
.completed-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 12px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}
.completed-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Property Cards (Overview Stat Grid) ────────── */
.btn-group {
    display: flex;
    gap: 8px;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header-left h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.property-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.property-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.property-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.property-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
}
.property-name i {
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
}
.property-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.property-arrow {
    font-size: 12px;
    color: var(--text-dim);
    flex-shrink: 0;
}
.property-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 10px;
    min-height: 20px;
}
.stat-inline {
    font-size: 12px;
    font-weight: 600;
}
.stat-inline-red { color: var(--red); }
.stat-inline-yellow { color: var(--orange); }
.stat-inline-blue { color: var(--blue); }
.stats-inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 4px 0;
    min-height: 28px;
}
.property-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.property-footer i {
    margin-right: 4px;
}

/* ── Member Detail Page ────────────────────────── */
.members-detail-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.member-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.member-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.member-detail-avatar {
    font-size: 30px;
    color: var(--accent);
    flex-shrink: 0;
}
.member-detail-info {
    flex: 1;
    min-width: 0;
}
.member-detail-name {
    font-weight: 600;
    font-size: 15px;
}
.member-detail-role {
    font-size: 12px;
    color: var(--text-dim);
}
.member-detail-stats {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.mini-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-dim);
}
.mini-stat-red { background: var(--red-bg); color: var(--red); }
.mini-stat-yellow { background: var(--orange-bg); color: var(--orange); }
.mini-stat-blue { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.mini-stat-green { background: var(--green-bg); color: var(--green); }
.member-detail-body {
    padding: 12px 16px;
}

/* ── Member Stat Cards (Location Detail Grid) ──── */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.member-stat-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.member-stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.member-stat-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.member-stat-avatar {
    font-size: 28px;
    color: var(--accent);
    flex-shrink: 0;
}
.member-stat-info {
    flex: 1;
    min-width: 0;
}
.member-stat-name {
    font-size: 14px;
    font-weight: 700;
}
.member-stat-role {
    font-size: 11px;
    color: var(--text-dim);
}
.member-role-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(108, 140, 255, 0.1);
    padding: 3px 10px;
    border-radius: 6px;
}
.member-stat-card .property-stats-row {
    margin-bottom: 10px;
}
.member-stat-card .property-footer {
    padding-top: 8px;
}

/* ── Date Picker ──────────────────────────────── */
.date-picker-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.date-picker-wrap .date-input {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.date-picker-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.date-picker-btn:hover {
    background: var(--accent-hover);
}
.date-picker-btn i {
    pointer-events: none;
}

/* ── Responsive ─────────────────────────────────── */

/* Tablet (768px-1023px) — minor adjustments only */
@media (max-width: 1023px) {
    .property-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .member-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .location-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Phone (<768px) — compact, concise, touch-friendly */
@media (max-width: 767px) {
    body { font-size: 13px; overflow-x: hidden; position: relative; }
    .main { padding: 12px; overflow-x: hidden; }
    .card, .nav, .nav-inner, .page-header, .stats-row, .dashboard-grid,
    .right-column, .property-grid, .member-grid, .members-detail-list,
    .location-grid, .member-card, .login-card, .filter-tabs,
    .stats-inline-row, .flash-container { max-width: 100%; }

    /* Nav */
    .nav-inner { padding: 0 12px; height: 48px; }
    .nav-link { padding: 6px 10px; font-size: 13px; }
    .nav-links .nav-link span { display: none; }
    .badge { font-size: 10px; min-width: 16px; padding: 1px 5px; }

    /* Stats */
    .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-number { font-size: 24px; }

    /* Dashboard */
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-section { margin-bottom: 12px !important; }
    .right-column { gap: 12px; }

    /* Cards */
    .card-header { padding: 10px 14px; }
    .card-header h2, .card-header h3 { font-size: 14px; }
    .card-body { padding: 10px 14px; }

    /* Tasks */
    .task-item { padding: 8px 10px; gap: 8px; }
    .task-title { font-size: 13px; }
    .task-desc { font-size: 12px; display: none; }
    .task-check { font-size: 16px; }
    .tag { font-size: 10px; padding: 1px 6px; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-header h1 { font-size: 18px; }
    .page-header-left h1 { font-size: 18px; }
    .page-header-left { flex-wrap: wrap; gap: 8px; }

    /* Buttons */
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }
    .btn-group { flex-wrap: wrap; }

    /* Property grid */
    .property-grid { grid-template-columns: 1fr; gap: 10px; }
    .property-card { padding: 14px; }
    .property-name { font-size: 13px; }
    .property-stats-row { gap: 3px 10px; }
    .property-footer { font-size: 11px; }

    /* Member stat grid */
    .member-grid { grid-template-columns: 1fr; gap: 10px; }
    .member-stat-card { padding: 14px; }
    .member-stat-name { font-size: 13px; }

    /* Member detail */
    .member-role-tag { font-size: 10px; padding: 2px 8px; }
    .member-detail-card { }
    .member-detail-header { padding: 10px 12px; }
    .member-detail-avatar { font-size: 24px; }
    .member-detail-name { font-size: 14px; }
    .member-detail-body { padding: 10px 12px; }
    .mini-stat { min-width: 22px; height: 22px; font-size: 11px; }

    /* Filter tabs */
    .filter-tabs { overflow-x: auto; width: 100%; padding: 3px; gap: 2px; }
    .filter-tab { padding: 6px 12px; font-size: 12px; white-space: nowrap; }

    /* Calendar */
    .calendar-event { padding: 8px 0; gap: 10px; }
    .cal-day { font-size: 22px; }
    .calendar-event-title { font-size: 13px; }
    .calendar-event-details { font-size: 12px; }

    /* Modal - full screen on phone */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { max-width: 100%; max-height: 85vh; border-radius: 12px 12px 0 0; }
    .modal-header { padding: 14px 16px; }
    .modal-form { padding: 16px; }
    .input { padding: 8px 10px; font-size: 13px; }

    /* Date picker */
    .date-picker-btn { width: 32px; height: 32px; font-size: 12px; }

    /* Events mini */
    .event-mini-day { font-size: 16px; }

    /* Done list */
    .done-item { font-size: 12px; }
    .done-time { display: none; }

    /* Recently done - hide on phone */
    .dashboard-section:last-child .done-list .done-time { display: none; }

    /* Stats inline */
    .stats-inline-row { font-size: 12px; gap: 4px 12px; }

    /* Form rows */
    .form-row { grid-template-columns: 1fr; }
}

/* Small phone (<420px) — extra compact */
@media (max-width: 420px) {
    .main { padding: 8px; }
    .nav-inner { padding: 0 8px; }
    .stat-number { font-size: 20px; }
    .stat-card { padding: 8px; }
    .nav-brand { font-size: 12px; }
    .nav-logo { height: 18px; }
    .page-header h1 { font-size: 16px; }
    .card-header { padding: 8px 10px; }
    .card-header h2 { font-size: 13px; }
    .card-body { padding: 8px 10px; }
}
