/* ------------------ Base and Typography ------------------ */
body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* ------------------ Sidebar and Main Content Layout ------------------ */
.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  background-color: #1e1e2f; 
  color: #fff;
  padding: 20px;
  box-sizing: border-box;
}

.sidebar h2 {
    /* Hide on mobile when sidebar is hidden */
    display: block; 
}

.sidebar a {
  display: block;
  color: #fff;
  padding: 10px;
  text-decoration: none;
  margin: 5px 0;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.sidebar a.active,
.sidebar a:hover {
  background-color: #33334d;
}

.content {
  flex: 1;
  background-color: #f9f9f9;
  padding: 20px;
  overflow: auto;
}

/* ------------------ General Buttons and Inputs ------------------ */

/* Global add-btn for Dashboards and Management pages (kept simple) */
.add-btn {
  background: #28a745; 
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 20px; /* Applies spacing to the button below the header */
}

/* Base style for input/select elements to prevent layout shift */
input[type="date"], 
input[type="time"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="text"], 
select, 
textarea,
.btn-ghost {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
}
.btn-ghost {
  background:#f7f7f9;
  cursor: pointer;
}


/* ------------------ FILTERS (Revenues Page Specific Styling) ------------------ */
/* Targeted styling for the Revenues Report filter bar (uses the box/shadow look) */

.content .filters {
  display: flex;
  gap: 15px; 
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 20px; 
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.content .filters label {
  font-weight: 600;
  color: #333;
}

/* ------------------ Summary Cards Styling (Revenues Page Specific) ------------------ */
.summary-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.card {
  flex: 1;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-left: 5px solid;
}
.card h3 {
  margin-top: 0;
  font-size: 14px;
  color: #555;
}
.card .value {
  font-size: 24px;
  font-weight: bold;
}
.card.revenue { border-color: #28a745; }
.card.revenue .value { color: #28a745; } 
.card.paid { border-color: #007bff; }
.card.paid .value { color: #007bff; } 
.card.due { border-color: #dc3545; }
.card.due .value { color: #dc3545; } 


/* ------------------ Table Styles ------------------ */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 8px;
}

table th {
  background-color: #007bff; 
  color: #fff;
  text-align: center;
}

/* Base style for data cells - White background */
table td {
  text-align: center;
  background: #fff; 
}

.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 2px;
}
.edit-btn { color: #007bff; } 
.finance-btn { color: #28a745; }
.delete-btn { color: #dc3545; }

/* ------------------ Modal Styles (Used by Edit/Revenues Modal) ------------------ */
.modal {
  display: none; 
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.closeBtn {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.closeBtn:hover {
  color: #000;
}

form label {
  display: block;
  margin-top: 10px;
}

form input, form textarea, form select { /* Added form select */
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.save-btn {
  background: #007bff;
  color: #fff;
  border: none;
  margin-top: 15px;
  padding: 10px;
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
}

.required {
  color: red;
}


/* --- DASHBOARD BOOKING STATUS Highlighting (Applies ONLY to Dashboard Table) --- */
#dashboardTable tr.status-arranged {
  background-color: #e0f7ff !important; /* Light Blue */
}
#dashboardTable tr.status-completed {
  background-color: #e6ffed !important; /* Light Green */
}
#dashboardTable tr.status-cancelled {
  background-color: #ffe6e6 !important; /* Light Red */
}

/* Ensure table cells inherit the row background */
#dashboardTable tr.status-arranged td { background-color: inherit; }
#dashboardTable tr.status-completed td { background-color: inherit; }
#dashboardTable tr.status-cancelled td { background-color: inherit; }


/* ------------------ REVENUES PAGE PAYMENT STATUS HIGHLIGHTING (Global/Default) ------------------ */

/* 1. PAID (Full Payment) - Light Green Row */
.payment-status-paid {
    font-weight: bold;
    color: #155724; 
}
table tr:has(.payment-status-paid) {
    background-color: #d4edda !important; 
}

/* 2. BILLED (Partial or Balance Due) - Light Yellow/Orange Row */
.payment-status-billed {
    font-weight: bold;
    color: #856404; 
}
table tr:has(.payment-status-billed) {
    background-color: #fff3cd !important; 
}

/* 3. UNINVOICED (Final Price is 0) - Light Gray Row */
.payment-status-uninvoiced {
    font-style: italic;
    color: #6c757d; 
}
table tr:has(.payment-status-uninvoiced) {
    background-color: #f8f9fa !important; 
}

/* Ensure ALL cells in the row inherit the background set by the payment status */
table tr:has(.payment-status-paid) td,
table tr:has(.payment-status-billed) td,
table tr:has(.payment-status-uninvoiced) td {
    background-color: inherit;
}

/* ------------------ MOBILE RESPONSIVENESS (New Section) ------------------ */

/* Menu Toggle Button (Hidden by default on desktop) */
.mobile-menu-btn {
    display: none; 
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 20px;
    cursor: pointer;
    z-index: 210; 
    position: fixed;
    top: 10px;
    right: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    
    /* Show the menu button */
    .mobile-menu-btn {
        display: block; 
    }
    
    .container {
        flex-direction: column; 
        height: auto; 
    }

    /* Sidebar: Fixed, full height, but off-screen */
    .sidebar {
        width: 220px; /* Fixed width for menu content */
        position: fixed; 
        left: -220px; /* Hide off-screen */
        top: 0;
        bottom: 0;
        z-index: 200; 
        transition: left 0.3s ease;
    }
    
    /* Move content to make room for the fixed button area */
    .content {
        padding-top: 50px; 
    }

    /* Show the sidebar when the body has the 'sidebar-open' class */
    body.sidebar-open .sidebar {
        left: 0;
    }
    
    /* Filter Bar: Stack controls vertically */
    .content .filters {
        flex-direction: column; 
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }
    .filters label {
        margin-top: 5px;
    }
    .filters input,
    .filters select,
    .filters button,
    .filters .btn-ghost {
        width: 100%; 
        box-sizing: border-box;
    }
    
    /* Summary Cards: Stack them vertically */
    .summary-cards {
        flex-direction: column;
        gap: 10px;
    }

    /* Modal: Make it wider for easier form filling */
    .modal-content {
        width: 90%; 
        margin: 20px auto; 
    }
}