/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Manrope', sans-serif; background: #F7FAF8; color: #1A251E; min-height: 100vh; }
h1,h2,h3,h4 { font-family: 'Outfit', sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; font-size: 0.875rem; }
table { border-collapse: collapse; width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F7FAF8; }
::-webkit-scrollbar-thumb { background: #E5EBE7; border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-page { display: flex; min-height: 100vh; }
.login-left { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; background: #fff; }
.login-form-wrap { width: 100%; max-width: 420px; }
.login-logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.login-logo-icon { width: 40px; height: 40px; border-radius: 12px; background: #2F5233; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.125rem; font-family: 'Outfit'; }
.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: #1A251E; }
.login-subtitle { color: #5C6B61; margin-top: 1rem; margin-bottom: 2rem; font-size: 0.95rem; }
.login-right { flex: 1; position: relative; overflow: hidden; display: none; }
.login-right img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-right-overlay { position: absolute; inset: 0; background: rgba(47,82,51,0.3); }
.login-right-text { position: absolute; bottom: 3rem; left: 3rem; z-index: 2; }
.login-right-text h2 { font-size: 1.75rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.login-right-text p { color: rgba(255,255,255,0.8); max-width: 320px; font-size: 0.95rem; }
@media(min-width:1024px) { .login-right { display: block; } }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #5C6B61; margin-bottom: 0.5rem; }
.form-input { width: 100%; border: 1px solid #E5EBE7; background: #fff; border-radius: 12px; padding: 0.75rem 1rem; font-size: 0.875rem; color: #1A251E; transition: all 0.2s; outline: none; }
.form-input:focus { border-color: #2F5233; box-shadow: 0 0 0 3px rgba(148,201,115,0.25); }
.form-input::placeholder { color: #9CA3AF; }
.form-input-wrap { position: relative; }
.form-input-wrap .toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; color: #5C6B61; font-size: 0.8rem; padding: 4px; }
.form-select { width: 100%; border: 1px solid #E5EBE7; background: #fff; border-radius: 12px; padding: 0.75rem 1rem; font-size: 0.875rem; color: #1A251E; outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235C6B61' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.form-select:focus { border-color: #2F5233; box-shadow: 0 0 0 3px rgba(148,201,115,0.25); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-error { margin-bottom: 1.25rem; padding: 0.75rem 1rem; border-radius: 12px; background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; font-size: 0.85rem; }
.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media(max-width:640px) { .form-row-2, .form-row-3 { grid-template-columns: 1fr; } }
.form-section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #2F5233; margin-bottom: 0.75rem; margin-top: 0.5rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 12px; font-size: 0.875rem; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: #2F5233; color: #fff; }
.btn-primary:hover { background: #243E26; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: #E8F3EA; color: #2F5233; }
.btn-secondary:hover { background: #D5E8D8; }
.btn-outline { background: #fff; color: #1A251E; border: 1px solid #E5EBE7; }
.btn-outline:hover { background: #F0F5F1; }
.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 0.75rem; font-size: 0.8rem; border-radius: 8px; }
.btn-icon { padding: 0.5rem; border-radius: 8px; background: none; color: #5C6B61; transition: all 0.2s; }
.btn-icon:hover { background: #E8F3EA; color: #2F5233; }
.btn-icon.danger:hover { background: #FEF2F2; color: #EF4444; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #fff; border-right: 1px solid #E5EBE7; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 30; }
.sidebar-logo { padding: 1.5rem; border-bottom: 1px solid #E5EBE7; display: flex; align-items: center; gap: 0.75rem; }
.sidebar-logo-icon { width: 36px; height: 36px; border-radius: 8px; background: #2F5233; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-family: 'Outfit'; }
.sidebar-logo-text h2 { font-size: 1rem; font-weight: 700; color: #1A251E; }
.sidebar-logo-text p { font-size: 0.7rem; color: #5C6B61; }
.sidebar-nav { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 12px; font-size: 0.875rem; font-weight: 500; color: #5C6B61; transition: all 0.2s; cursor: pointer; background: none; width: 100%; text-align: left; }
.nav-link:hover { background: #F0F5F1; color: #1A251E; }
.nav-link.active { background: #E8F3EA; color: #2F5233; }
.nav-link svg { width: 18px; height: 18px; stroke-width: 1.5; }
.sidebar-footer { padding: 1rem; border-top: 1px solid #E5EBE7; }
.main-content { flex: 1; margin-left: 240px; padding: 2rem; overflow-x: hidden; }
.main-inner { max-width: 1200px; margin: 0 auto; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: #1A251E; }
.page-header p { color: #5C6B61; margin-top: 0.25rem; font-size: 0.95rem; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* ===== RESPONSIVE SIDEBAR ===== */
.mobile-header { display: none; background: #fff; border-bottom: 1px solid #E5EBE7; padding: 1rem 1.5rem; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.mobile-header-logo { display: flex; align-items: center; gap: 0.5rem; }
.hamburger { background: none; font-size: 1.5rem; color: #1A251E; padding: 4px; }
@media(max-width:768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1rem; }
  .mobile-header { display: flex; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 25; }
  .sidebar-backdrop.open { display: block; }
}

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid #E5EBE7; border-radius: 16px; padding: 1.5rem; transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.stat-card-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #5C6B61; }
.stat-card-icon { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-card-icon svg { width: 16px; height: 16px; }
.stat-card-icon.green { background: #E8F3EA; color: #2F5233; }
.stat-card-icon.emerald { background: #D1FAE5; color: #059669; }
.stat-card-icon.amber { background: #FEF3C7; color: #D97706; }
.stat-card-icon.rose { background: #FFE4E6; color: #E11D48; }
.stat-card-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-card-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-card-value { font-family: 'Outfit'; font-size: 2.25rem; font-weight: 700; color: #1A251E; }

/* ===== TABLE ===== */
.card { background: #fff; border: 1px solid #E5EBE7; border-radius: 16px; overflow: hidden; }
.card-header { padding: 1.5rem; border-bottom: 1px solid #E5EBE7; }
.card-header h2 { font-size: 1.125rem; font-weight: 600; color: #1A251E; }
.table-wrap { overflow-x: auto; }
table th { padding: 1rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #5C6B61; background: #F7FAF8; border-bottom: 1px solid #E5EBE7; text-align: left; white-space: nowrap; }
table td { padding: 1rem; font-size: 0.875rem; color: #1A251E; border-bottom: 1px solid rgba(229,235,231,0.5); white-space: nowrap; }
table tr:hover td { background: #F0F5F1; }
.empty-state { padding: 3rem; text-align: center; color: #5C6B61; }
.empty-state svg { margin: 0 auto 0.75rem; color: #E5EBE7; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 500; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-cancelled { background: #FFE4E6; color: #9F1239; }
.badge-completed { background: #DBEAFE; color: #1E40AF; }
.badge-paid { background: #D1FAE5; color: #065F46; }
.badge-partial { background: #FEF3C7; color: #92400E; }

/* ===== FILTERS ===== */
.filters-row { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; max-width: 400px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9CA3AF; width: 16px; height: 16px; }
.search-wrap input { padding-left: 2.5rem; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 40; }
.modal-container { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: #fff; border-radius: 24px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 2rem; border: 1px solid #E5EBE7; }
.modal-sm { max-width: 400px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.25rem; font-weight: 600; color: #1A251E; }
.modal-header p { font-size: 0.85rem; color: #5C6B61; margin-top: 0.25rem; }
.modal-close { background: none; color: #5C6B61; padding: 4px; border-radius: 8px; transition: all 0.2s; }
.modal-close:hover { background: #F0F5F1; color: #1A251E; }
.modal-footer { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.modal-footer .btn { flex: 1; }
.hidden { display: none !important; }

/* ===== CALENDAR ===== */
.calendar-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media(max-width:1024px) { .calendar-grid { grid-template-columns: 1fr; } }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.cal-header h3 { font-size: 1.125rem; font-weight: 600; color: #1A251E; }
.cal-nav { display: flex; gap: 0.5rem; }
.cal-nav button { width: 36px; height: 36px; border-radius: 8px; background: #fff; border: 1px solid #E5EBE7; display: flex; align-items: center; justify-content: center; color: #5C6B61; transition: all 0.2s; }
.cal-nav button:hover { background: #F0F5F1; color: #1A251E; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 0.5rem; }
.cal-weekdays span { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #5C6B61; padding: 0.5rem; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { text-align: center; padding: 0.5rem; border-radius: 8px; font-size: 0.875rem; cursor: pointer; transition: all 0.15s; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.cal-day:hover { background: #F0F5F1; }
.cal-day.today { background: #E8F3EA; color: #2F5233; font-weight: 600; }
.cal-day.booked { background: rgba(148,201,115,0.2); color: #2F5233; font-weight: 600; }
.cal-day.selected { background: #2F5233; color: #fff; font-weight: 600; }
.cal-day.outside { color: #E5EBE7; cursor: default; }
.cal-day.outside:hover { background: transparent; }
.cal-legend { display: flex; gap: 1.5rem; margin-top: 1rem; }
.cal-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: #5C6B61; }
.cal-legend-item span { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ===== AVAILABILITY RESULT ===== */
.avail-result { margin-top: 0.75rem; padding: 1rem; border-radius: 12px; }
.avail-result.available { background: #D1FAE5; border: 1px solid #A7F3D0; }
.avail-result.unavailable { background: #FEF3C7; border: 1px solid #FDE68A; }
.avail-result .result-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.avail-result.available .result-header { color: #065F46; }
.avail-result.unavailable .result-header { color: #92400E; }
.avail-result .conflict-item { font-size: 0.8rem; color: #92400E; margin-top: 0.5rem; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1.25rem; border-radius: 12px; font-size: 0.85rem; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.1); animation: slideIn 0.3s ease; }
.toast.success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.toast.error { background: #FFE4E6; color: #9F1239; border: 1px solid #FECACA; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== DETAIL VIEW ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-item label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: #5C6B61; margin-bottom: 0.25rem; }
.detail-item p { font-size: 0.875rem; color: #1A251E; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .note-box { background: #F7FAF8; padding: 0.75rem; border-radius: 12px; margin-top: 0.25rem; }

/* ===== SPINNER ===== */
.spinner { width: 32px; height: 32px; border: 3px solid rgba(47,82,51,0.15); border-top-color: #2F5233; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner-sm { width: 18px; height: 18px; border-width: 2px; border-color: rgba(255,255,255,0.3); border-top-color: #fff; margin: 0; }
