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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

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

/* Header */
header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4361ee;
}

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user { color: #666; font-size: 0.9rem; }

.nav-link {
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
}
.nav-link:hover { background: #f0f0f0; color: #1a1a2e; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    background: #f0f0f0;
    color: #1a1a2e;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3a56d4; box-shadow: 0 4px 12px rgba(67,97,238,0.3); }
.btn-success { background: #10b981; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1.1rem; }

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
}
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: 0.9; }

/* Property Cards Grid */
.properties-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.property-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.property-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.property-image { height: 220px; overflow: hidden; }
.property-image img { width: 100%; height: 100%; object-fit: cover; }
.property-image-placeholder {
    height: 100%; display: flex; align-items: center; justify-content: center;
    background: #e8ecf4;
}
.property-image-placeholder svg { width: 48px; height: 48px; color: #94a3b8; }

.property-info { padding: 1.5rem; }
.property-info h2 { margin-bottom: 0.5rem; }
.property-info h2 a:hover { color: #4361ee; }
.property-desc { color: #666; font-size: 0.95rem; margin-bottom: 1rem; }
.property-meta { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.price { font-weight: 700; font-size: 1.2rem; color: #4361ee; }
.guests { color: #666; }
.amenity-tag {
    display: inline-block;
    background: #f0f4ff;
    color: #4361ee;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0 0.3rem 0.3rem 0;
}

/* Property Gallery */
.property-gallery { margin-bottom: 2rem; }
.gallery-main { border-radius: 12px; overflow: hidden; margin-bottom: 0.5rem; }
.gallery-main img { width: 100%; height: 450px; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.gallery-thumb { width: 100px; height: 70px; border-radius: 8px; overflow: hidden; cursor: pointer; flex-shrink: 0; opacity: 0.6; transition: opacity 0.2s, border 0.2s; border: 2px solid transparent; }
.gallery-thumb:hover { opacity: 0.85; }
.gallery-thumb.active { opacity: 1; border-color: #4361ee; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Property Detail */
.property-detail { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.property-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.property-main h1 { font-size: 2rem; margin-bottom: 1rem; }
.property-description { color: #555; margin-bottom: 2rem; white-space: pre-line; }
.property-features { display: flex; gap: 2rem; margin-bottom: 2rem; }
.feature { display: flex; align-items: center; gap: 0.5rem; }
.feature-icon { font-size: 1.3rem; }

.amenities-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; margin-bottom: 2rem; }
.amenities-list li { padding: 0.5rem 0; border-bottom: 1px solid #eee; }

.booking-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 80px;
}
.price-display { margin-bottom: 1.5rem; }
.rate { font-size: 1.8rem; font-weight: 700; color: #4361ee; }
.rate-unit { font-size: 1rem; color: #666; }
.cleaning { display: block; font-size: 0.9rem; color: #666; margin-top: 0.3rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.6rem; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 3px rgba(67,97,238,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.form-hint { font-size: 0.85rem; color: #888; margin-bottom: 0.3rem; }
.checkbox-group label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }

.price-summary { border-top: 1px solid #eee; margin-top: 1rem; padding-top: 1rem; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; }
.summary-row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid #eee; padding-top: 0.5rem; }

/* Booking Page */
.booking-page { max-width: 1000px; margin: 0 auto; padding: 2rem; }
.booking-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.booking-summary-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; margin: 1rem 0; }
.booking-summary-card h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.summary-line { display: flex; justify-content: space-between; padding: 0.5rem 0; }
.summary-line.total { border-top: 2px solid #eee; padding-top: 0.75rem; font-size: 1.2rem; }

.payment-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; }
.payment-desc { color: #666; margin-bottom: 1.5rem; }
#card-element { padding: 1rem; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 1rem; background: #fff; }
.payment-error { color: #ef4444; font-size: 0.9rem; margin-bottom: 1rem; }

/* Confirm Page */
.confirm-page { max-width: 600px; margin: 3rem auto; padding: 0 2rem; }
.confirm-card { background: #fff; border-radius: 12px; padding: 2.5rem; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.confirm-icon { font-size: 4rem; color: #10b981; margin-bottom: 1rem; }
.confirm-card h1 { margin-bottom: 1rem; }
.confirm-desc { color: #666; margin-bottom: 2rem; }
.confirm-details { text-align: left; background: #f8f9fa; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.detail-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.detail-row:last-child { border-bottom: none; }
.confirm-note { color: #666; margin-bottom: 2rem; font-size: 0.95rem; }

/* Flash Messages */
.flash-container { max-width: 1200px; margin: 1rem auto 0; padding: 0 2rem; }
.flash { background: #fef3c7; color: #92400e; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 0.5rem; }
.flash-success { background: #d1fae5; color: #065f46; }

/* Empty State */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state h2 { margin-bottom: 0.5rem; color: #666; }
.empty-state p { color: #888; margin-bottom: 1.5rem; }

/* Footer */
footer { text-align: center; padding: 1.5rem; color: #999; font-size: 0.85rem; background: #fff; border-top: 1px solid #eee; margin-top: auto; }

/* Admin Layout */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-header { padding: 0 1.5rem; margin-bottom: 2rem; }
.sidebar-logo { color: #fff; font-size: 1.3rem; font-weight: 700; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #a0aec0;
    transition: all 0.2s;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link.active { border-left: 3px solid #4361ee; }
.logout-link { margin-top: 1rem; color: #ef4444; }
.sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 1rem 1.5rem; }
.sidebar-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.badge { background: #ef4444; color: #fff; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 10px; margin-left: auto; }

.admin-content { margin-left: 240px; flex: 1; padding: 2rem; background: #f1f5f9; min-height: 100vh; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.8rem; }
.admin-user { display: flex; align-items: center; gap: 0.75rem; }
.admin-avatar { width: 32px; height: 32px; border-radius: 50%; }

.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 1.2rem; }
.card-body { padding: 1.5rem; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

/* Admin Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 12px; padding: 1.5rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-icon { font-size: 2rem; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: #f0f4ff; border-radius: 10px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #4361ee; }
.stat-label { font-size: 0.85rem; color: #666; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #e2e8f0; font-size: 0.85rem; color: #666; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid #f0f0f0; font-size: 0.95rem; }
.table tr:hover { background: #f8f9fa; }

.status { padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: capitalize; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved, .status-paid { background: #d1fae5; color: #065f46; }
.status-rejected, .status-cancelled, .status-failed { background: #fee2e2; color: #991b1b; }
.status-refunded { background: #e0e7ff; color: #3730a3; }
.status-unpaid { background: #f3f4f6; color: #4b5563; }

.text-muted { color: #999; }
.empty-text { color: #888; padding: 2rem; text-align: center; }

/* Role Badges */
.role-badge {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.role-badge-sm {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-right: 0.25rem;
}
.role-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.role-checkbox {
    display: flex; align-items: center; gap: 0.5rem;
    background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 0.5rem 0.75rem; cursor: pointer; transition: border-color 0.2s;
}
.role-checkbox:hover { border-color: #4361ee; }
.role-checkbox input { margin: 0; }
.role-name { font-weight: 600; text-transform: capitalize; }
.role-level { color: #888; font-size: 0.8rem; }
.property-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.property-checkbox {
    display: flex; align-items: center; gap: 0.5rem;
    background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 0.5rem 0.75rem; cursor: pointer;
}
.property-checkbox:hover { border-color: #4361ee; }
.property-checkbox input { margin: 0; }

/* Property Admin List */
.properties-admin-list { display: flex; flex-direction: column; gap: 1rem; }
.property-admin-card { background: #fff; border-radius: 8px; padding: 1rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.property-admin-card.inactive { opacity: 0.6; }
.property-admin-thumb { width: 80px; height: 60px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.property-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 100%; height: 100%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: #94a3b8; }
.property-admin-info { flex: 1; }
.property-admin-info h3 { margin-bottom: 0.25rem; }
.property-admin-info p { color: #666; font-size: 0.9rem; }
.property-admin-actions { display: flex; gap: 0.5rem; }
.badge-inactive { background: #f3f4f6; color: #666; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; }

/* Property Form */
.property-form { max-width: 800px; }
.section-title { font-size: 1.1rem; margin: 1.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid #eee; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #eee; }

/* Photo Upload */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.photo-item { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-delete {
    position: absolute; top: 4px; right: 4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,0,0,0.7); color: #fff;
    border: none; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.upload-area {
    border: 2px dashed #ddd; border-radius: 8px; padding: 2rem;
    text-align: center; cursor: pointer; transition: border-color 0.2s;
    position: relative; min-height: 80px;
}
.upload-area:hover { border-color: #4361ee; }
.upload-area input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-area p { color: #888; margin: 0; pointer-events: none; }

.upload-status { margin-top: 0.75rem; }
.upload-item { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.upload-filename { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.upload-bar-bg { flex: 2; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.upload-bar { height: 100%; background: #4361ee; border-radius: 3px; transition: width 0.2s; }
.upload-pct { font-size: 0.8rem; color: #666; min-width: 40px; text-align: right; }
.upload-success .upload-bar { background: #10b981; }
.upload-success .upload-pct { color: #10b981; }
.upload-error .upload-bar { background: #ef4444; }
.upload-error .upload-pct { color: #ef4444; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .property-layout, .booking-layout { grid-template-columns: 1fr; }
    .property-gallery { grid-template-columns: 1fr; }
    .property-gallery img.main { grid-row: auto; height: 250px; }
    .admin-sidebar { width: 60px; }
    .admin-content { margin-left: 60px; }
    .sidebar-link span:not(.sidebar-icon) { display: none; }
    .sidebar-logo { font-size: 1rem; }
    .properties-grid { grid-template-columns: 1fr; }
}
