:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --success-hover: #15803d;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Nav */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--gray-200);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 16px;
}
.nav-brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    text-decoration: none;
    margin-right: auto;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-links a {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    padding: 8px 4px;
}
.nav-links a:hover { color: var(--primary); }
.btn-link {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 15px;
    cursor: pointer;
    padding: 8px 4px;
}
.btn-link:hover { color: var(--danger); }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: transform 0.2s;
}

@media (max-width: 600px) {
    .hamburger { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 8px 16px 16px;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--gray-200);
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links .btn-link {
        padding: 12px 0;
        font-size: 16px;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

@media (min-width: 768px) {
    .container { padding: 24px; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
    text-decoration: none;
    line-height: 1.2;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover:not(:disabled) { border-color: var(--gray-500); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-icon {
    min-height: 36px;
    width: 36px;
    padding: 0;
    border-radius: var(--radius);
    background: none;
    border: 1px solid var(--gray-200);
    color: var(--gray-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.btn-icon:hover { background: var(--gray-100); }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--gray-700);
}
input[type="text"],
input[type="password"],
input[type="search"],
input[type="date"],
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: white;
    color: var(--gray-900);
    transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
textarea { resize: vertical; min-height: 80px; }
.form-error { color: var(--danger); font-size: 14px; margin-top: 6px; }

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
    border: 1px solid var(--gray-200);
}
.card-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
}
.card-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-clickable:active { transform: translateY(0); }
.card-list { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 768px) {
    .card-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (min-width: 1024px) {
    .card-list { grid-template-columns: repeat(3, 1fr); }
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Property type badge */
.type-badge {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: capitalize;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--gray-500);
}
.empty-state h2 { font-size: 18px; margin-bottom: 8px; color: var(--gray-700); }
.empty-state p { margin-bottom: 16px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.3s ease;
    max-width: calc(100% - 32px);
    text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.hidden { display: none; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* Sticky bar */
.sticky-bar {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    margin: 0 -16px;
    z-index: 50;
}

/* Checklist */
.section-group { margin-bottom: 16px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid var(--gray-200);
    cursor: pointer;
    user-select: none;
}
.section-header h3 { font-size: 16px; font-weight: 600; }
.section-header .section-progress {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}
.section-header .collapse-icon {
    font-size: 12px;
    color: var(--gray-500);
    transition: transform 0.2s;
    margin-left: 8px;
}
.section-header.collapsed .collapse-icon { transform: rotate(-90deg); }
.section-items { padding: 0; }
.section-items.collapsed { display: none; }

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.checklist-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}
.item-content { flex: 1; min-width: 0; }
.item-label { font-size: 15px; line-height: 1.4; }
.item-label.checked { color: var(--gray-500); text-decoration: line-through; }
.item-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.item-notes {
    width: 100%;
    margin-top: 8px;
    min-height: 60px;
    font-size: 14px;
    resize: vertical;
}
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.photo-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    position: relative;
}
.photo-thumb-wrapper {
    position: relative;
    display: inline-block;
}
.photo-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px solid white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius);
    background: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 13px;
}
.photo-upload-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 48px;
    color: var(--gray-500);
}
