:root {
    --primary-color: #5a4049;
    --accent-color: #d19a8a; 
    --bg-color: #F5EBEB; 
    --card-bg: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Lato', sans-serif; }

body.crm-body { background-color: var(--bg-color); color: var(--primary-color); overflow-x: hidden; }
h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* AUTHENTICATION */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.auth-box { background: var(--card-bg); padding: 40px; border-radius: 20px; box-shadow: 0 15px 40px rgba(90, 64, 73, 0.1); width: 100%; max-width: 400px; text-align: center; }
.auth-logo { width: 70px; height: 70px; margin-bottom: 20px; object-fit: contain; }
.auth-box h2 { margin-bottom: 20px; color: var(--primary-color); font-size: 2rem; }

.crm-input { width: 100%; padding: 14px 15px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; outline: none; transition: 0.3s; }
.crm-input:focus { border-color: var(--accent-color); box-shadow: 0 0 8px rgba(209, 154, 138, 0.3); }

.btn-primary { width: 100%; background: var(--primary-color); color: white; border: none; padding: 14px; border-radius: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { background: var(--accent-color); }

/* DASHBOARD LAYOUT */
#dashboard-container { display: flex; }
.crm-sidebar { width: 250px; background: var(--primary-color); color: white; height: 100vh; padding: 20px 0; position: fixed; display: flex; flex-direction: column; }
.sidebar-brand { text-align: center; margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.sidebar-logo { width: 60px; height: 60px; }
.role-badge { font-size: 0.75rem; background: var(--accent-color); color: #0f0f10; padding: 3px 10px; border-radius: 12px; font-weight: bold; text-transform: uppercase; margin-top: 5px; display: inline-block; }

.sidebar-menu { list-style: none; flex: 1; display: flex; flex-direction: column; }
.sidebar-menu li { padding: 15px 25px; cursor: pointer; font-size: 1rem; transition: 0.3s; border-left: 4px solid transparent; }
.sidebar-menu li:hover, .sidebar-menu li.active { background: rgba(255,255,255,0.1); border-left-color: var(--accent-color); color: var(--accent-color); }

.crm-main { margin-left: 250px; flex: 1; padding: 30px 40px; background: var(--bg-color); min-height: 100vh; }
.crm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 2px solid #eaddd7; padding-bottom: 15px; }

.crm-tab { display: none; animation: fadeIn 0.3s ease; }
.crm-tab.active-tab { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* MODALS */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { margin: auto; position: relative; top: 50%; transform: translateY(-50%); }

.mobile-nav-toggle { display: none; }

@media (max-width: 850px) {
    #dashboard-container { flex-direction: column; }
    .crm-main { margin-left: 0; padding: 20px; }
    .crm-sidebar { display: none; width: 220px; position: absolute; top: 70px; right: 20px; height: auto; border-radius: 12px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
    .crm-sidebar.show-menu { display: flex; }
    .mobile-nav-toggle { display: block; font-size: 2rem; cursor: pointer; color: var(--primary-color); }
    .sidebar-brand { display: none; }
}

/* ==========================================
   CRM CARDS & GRIDS
========================================== */
.crm-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.crm-card { background: var(--card-bg); padding: 20px; border-radius: 15px; box-shadow: 0 5px 20px rgba(90, 64, 73, 0.05); border: 1px solid rgba(200, 169, 106, 0.2); display: flex; flex-direction: column; }
.crm-card-header { display: flex; gap: 15px; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
.crm-card-dp { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-color); background: #f9f9f9; }
.crm-card-title { font-size: 1.3rem; font-family: 'Playfair Display', serif; color: var(--primary-color); margin-bottom: 3px; }
.crm-card-subtitle { font-size: 0.8rem; font-weight: bold; color: var(--accent-color); text-transform: uppercase; letter-spacing: 1px; }

.crm-card-body { flex: 1; font-size: 0.9rem; color: var(--primary-color); opacity: 0.85; margin-bottom: 15px; line-height: 1.6; }
.crm-card-body strong { color: #3C3633; }

.crm-card-actions { display: flex; gap: 10px; margin-top: auto; }
.btn-approve { flex: 1; background: #27ae60; color: white; border: none; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.btn-approve:hover { background: #219653; box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3); }
.btn-reject { flex: 1; background: #e74c3c; color: white; border: none; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.btn-reject:hover { background: #c0392b; box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3); }

/* ==========================================
   KANBAN PIPELINE
========================================== */
.kanban-board { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 15px; }
.kanban-column { flex: 1; min-width: 300px; background: #eaddd740; border-radius: 12px; display: flex; flex-direction: column; height: 70vh; }
.kanban-header { font-family: 'Playfair Display', serif; font-weight: bold; font-size: 1.2rem; padding: 15px; background: white; border-radius: 12px 12px 0 0; border-top: 4px solid var(--accent-color); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.kanban-badge { background: var(--accent-color); color: white; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; font-family: 'Lato', sans-serif; }
.kanban-body { padding: 15px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 15px; }

/* Booking Card */
.booking-card { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-left: 4px solid var(--accent-color); font-size: 0.9rem; }
.booking-card h4 { color: var(--primary-color); margin-bottom: 5px; font-size: 1.1rem; }
.booking-card .ticket-id { font-family: monospace; color: var(--accent-color); font-weight: bold; background: #fcf9f6; padding: 2px 5px; border-radius: 4px; font-size: 0.8rem; }
.booking-card-detail { opacity: 0.8; margin-top: 8px; line-height: 1.5; }
.booking-card-actions { margin-top: 15px; display: flex; gap: 10px; }
.btn-action-small { padding: 8px 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.8rem; width: 100%; transition: 0.2s; }
.btn-quote { background: var(--primary-color); color: white; }
.btn-quote:hover { background: var(--accent-color); }
.btn-contact { background: #f0f0f0; color: #333; text-decoration: none; text-align: center; }
.btn-contact:hover { background: #e0e0e0; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-switch input:checked + .toggle-slider { background-color: #e74c3c; box-shadow: 0 0 10px rgba(231, 76, 60, 0.5); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }
