@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --bg: #F7F8FC;
    --bg-card: #FFFFFF;
    --bg-hover: #F0F2F8;
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E5E7EB;
    --border-light: #F0F2F8;
    --primary: #6C63FF;
    --primary-hover: #5B52E0;
    --primary-light: #EDE9FE;
    --primary-text: #4F46B8;
    --success: #059669;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --info: #0284C7;
    --info-bg: #F0F9FF;
    --muted-bg: #F1F5F9;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 150ms ease;
    --font: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); font-size: 14px; }

.portal-header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; }
.portal-brand:hover { text-decoration: none; }
.portal-brand-dot { width: 28px; height: 28px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-nav a { padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--text-secondary); font-weight: 500; transition: all var(--transition); text-decoration: none; }
.portal-nav a:hover { background: var(--bg-hover); color: var(--text); }
.portal-nav a.active { background: var(--primary-light); color: var(--primary-text); }
.portal-user { display: flex; align-items: center; gap: 8px; }
.portal-user-name { font-size: 13px; font-weight: 500; }
.portal-user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.portal-logout { font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; transition: all var(--transition); }
.portal-logout:hover { background: var(--bg-hover); color: var(--text); }

.portal-container { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.portal-page-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.portal-page-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 22px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; border: 1px solid transparent; transition: all var(--transition); white-space: nowrap; cursor: pointer; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-link { background: none; border: none; color: var(--primary); padding: 4px 8px; font-weight: 500; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.form-input, .form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; color: var(--text); background: var(--bg-card); transition: border-color var(--transition); }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-input::placeholder { color: var(--text-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--text-secondary); }
.badge-primary { background: var(--primary-light); color: var(--primary-text); }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.room-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow var(--transition), transform var(--transition); cursor: pointer; }
.room-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.room-card-color { height: 6px; }
.room-card-body { padding: 18px 20px; }
.room-card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.room-card-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.room-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.room-card-meta span { display: flex; align-items: center; gap: 4px; }
.room-card-price { font-size: 18px; font-weight: 700; color: var(--primary); }
.room-card-price small { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.room-card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; }

.cal-wrapper { }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; font-size: 16px; color: var(--text-secondary); transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.cal-nav button:hover { background: var(--bg-hover); color: var(--text); }
.cal-month { font-size: 16px; font-weight: 600; min-width: 180px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-label { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; padding: 8px 0; }
.cal-day { text-align: center; padding: 10px 4px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; transition: all var(--transition); position: relative; }
.cal-day:hover { background: var(--bg-hover); }
.cal-day.today { font-weight: 700; color: var(--primary); }
.cal-day.selected { background: var(--primary); color: #fff; border-radius: var(--radius-sm); }
.cal-day.disabled { color: var(--text-muted); opacity: 0.4; pointer-events: none; }
.cal-day.has-slots::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.cal-day.no-slots::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.cal-day.empty { pointer-events: none; }

.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 16px; }
.slot-btn { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; transition: all var(--transition); }
.slot-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-text); }
.slot-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot-btn.unavailable { background: var(--muted-bg); color: var(--text-muted); pointer-events: none; border-color: transparent; text-decoration: line-through; }

.booking-summary { background: var(--primary-light); border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.booking-summary h3 { font-size: 15px; font-weight: 600; color: var(--primary-text); margin-bottom: 10px; }
.booking-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--text-secondary); }
.booking-summary-row strong { color: var(--text); }
.booking-summary-total { border-top: 1px solid rgba(0,0,0,0.08); margin-top: 8px; padding-top: 8px; font-size: 15px; font-weight: 600; color: var(--primary-text); }

.my-bookings-list { }
.my-booking-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.my-booking-item:last-child { border-bottom: none; }
.my-booking-color { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.my-booking-info { flex: 1; min-width: 0; }
.my-booking-room { font-size: 14px; font-weight: 600; }
.my-booking-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.my-booking-actions { display: flex; gap: 6px; align-items: center; }

.profile-section { margin-bottom: 24px; }
.profile-section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); transform: translateX(120%); transition: transform 0.3s ease; min-width: 280px; }
.toast.show { transform: translateX(0); }
.toast button { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.6; margin-left: auto; }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #F7F8FC 0%, #EDE9FE 100%); padding: 20px; }
.login-card { background: var(--bg-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 44px; width: 100%; max-width: 420px; border: 1px solid var(--border); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-mark { width: 52px; height: 52px; background: var(--primary); border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 22px; margin-bottom: 14px; }
.login-logo h1 { font-size: 24px; font-weight: 700; }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.login-divider { text-align: center; margin: 20px 0; font-size: 12px; color: var(--text-muted); position: relative; }
.login-divider::before, .login-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--muted-bg); border-radius: var(--radius-sm); padding: 3px; }
.login-tab { flex: 1; padding: 8px; text-align: center; font-size: 13px; font-weight: 500; border-radius: 4px; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); border: none; background: none; }
.login-tab.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 9000; opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(2px); }
.modal-overlay.show { opacity: 1; }
.modal-box { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; max-width: 480px; width: 90%; box-shadow: var(--shadow-md); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }

@media (max-width: 768px) {
    .portal-container { padding: 16px; }
    .portal-nav { display: none; }
    .room-grid { grid-template-columns: 1fr; }
    .slots-grid { grid-template-columns: repeat(3, 1fr); }
    .portal-header { padding: 0 16px; }
}
