/* Basic Reset & Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5; /* Light gray background */
    display: flex;
    min-height: 100vh; /* Ensure body takes full viewport height */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Sidebar Styling (from dashboard) */
.sidebar {
    width: 250px;
    background-color: #ffffff; /* White background */
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    display: flex;
    flex-direction: column;
    position: fixed; /* Fixed sidebar */
    height: 100%; /* Full height */
    left: 0;
    top: 0;
    overflow-y: auto; /* Enable scrolling for many menu items */
    z-index: 1000;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-weight: 600;
    font-size: 1.2em;
}

.sidebar .logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px; /* Rounded corners for logo image */
    object-fit: cover;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: #555;
    font-size: 1em;
    border-radius: 8px; /* Rounded corners for menu items */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar a i {
    font-size: 1.1em;
    color: #888;
}

.sidebar a:hover {
    background-color: #f0f2f5;
    color: #007bff; /* Blue on hover */
}

.sidebar a.active {
    background-color: #e0f2ff; /* Light blue background for active */
    color: #007bff; /* Blue text for active */
    font-weight: 500;
}

.sidebar a.active i {
    color: #007bff;
}

/* Main Content Area (general wrapper for dashboard/members pages) */
.content {
    flex-grow: 1;
    margin-left: 250px; /* Space for the fixed sidebar */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between sections */
    overflow-x: hidden; /* Prevent horizontal scroll on content area */
}

/* Header Styling (from dashboard) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 0px 10px;
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter-form { /* Added to ensure date input and button stay on one line */
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent wrapping within the form */
}

.date-filter input[type="text"] { /* Changed from date to text for Flatpickr */
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    color: #555;
    flex-grow: 1; /* Allow input to grow */
    min-width: 120px; /* Ensure it doesn't get too small */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-filter input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.date-filter .btn-filter {
    background-color: #007bff; /* Primary blue color */
    color: #ffffff;
    padding: 10px 15px;
    border: none;
    border-radius: 8px; /* Consistent with input */
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.date-filter .btn-filter:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 5px 10px rgba(0, 123, 255, 0.3);
}


.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu span {
    font-weight: 500;
    color: #333;
}

.user-menu a {
    color: #007bff;
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.user-menu a:hover {
    background-color: #f0f2f5;
}

/* Action Buttons Styling (from dashboard) */
.actions {
    display: flex;
    gap: 15px; /* Space between buttons */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.btn {
    background-color: #007bff; /* Primary blue color */
    color: #ffffff;
    padding: 12px 20px;
    border: none;
    border-radius: 10px; /* More rounded corners */
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2); /* Subtle shadow */
}

.btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

.btn-clear {
    background-color: #f6513b; /* blue-500 */
    color: white;
    padding: 8px 16px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(255, 51, 0, 0.2); /* Subtle shadow */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.btn i {
    font-size: 1.1em;
}

/* Summary Cards Styling (from dashboard) */
.cards {
    display: grid;
    /* Changed to auto-fit to allow flexible wrapping based on minmax */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.card { /* This .card style is now general, used for login/register as well */
    background-color: #ffffff;
    padding: 20px; /* Reduced padding for lesser height */
    border-radius: 15px; /* Significantly rounded corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* More prominent shadow */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #333; /* Default text color for login/register cards */
    min-height: 120px; /* Set a minimum height for consistency */
}

/* Gradient overlays for cards (only for dashboard summary cards) */
.cards .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--card-color-start), var(--card-color-end));
    border-radius: 15px;
    z-index: 1;
    opacity: 0.9;
}

.cards .card > * {
    position: relative;
    z-index: 2;
}

.cards .card strong {
    font-size: 1em; /* Slightly smaller for more cards */
    margin-bottom: 5px; /* Reduced margin */
    font-weight: 500;
    color: #fff; /* White text for dashboard cards */
}

.cards .card .value {
    font-size: 1.8em; /* Slightly smaller for more cards */
    font-weight: 700;
    margin-bottom: 10px; /* Reduced margin */
    color: #fff; /* White text for dashboard cards */
}

.cards .card a {
    align-self: flex-end;
    font-size: 0.8em; /* Slightly smaller */
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    color: #fff; /* White text for dashboard cards */
}

.cards .card a:hover {
    opacity: 1;
}

/* Specific card colors (from dashboard) */
.card.blue {
    --card-color-start: #2196F3; /* Light Blue */
    --card-color-end: #0D47A1; /* Dark Blue */
}

.card.gold {
    --card-color-start: #FFC107; /* Amber */
    --card-color-end: #FF8F00; /* Dark Amber */
}

.card.green {
    --card-color-start: #4CAF50; /* Green */
    --card-color-end: #2E7D32; /* Dark Green */
}

.card.purple {
    --card-color-start: #9C27B0; /* Purple */
    --card-color-end: #4A148C; /* Dark Purple */
}

/* Demographics & Upcoming Birthdays Section (from dashboard) */
.main-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.demographics {
    flex: 3; /* Takes 60% width roughly */
    min-width: 300px; /* Minimum width to prevent crushing */
    background-color: #ffffff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.demographics h4 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
}

.bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.bar-item label {
    flex-basis: 120px; /* Fixed width for labels */
    font-size: 0.95em;
    color: #555;
    white-space: nowrap; /* Prevent label wrapping */
}

.bar {
    flex-grow: 1; /* Bar takes remaining space */
    height: 18px;
    background-color: #e0e0e0; /* Light gray background for bar track */
    border-radius: 9px; /* Pill shape */
    position: relative;
    overflow: hidden; /* Ensure inner span doesn't overflow */
}

.bar span {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background-color: #007bff; /* Blue bar fill */
    border-radius: 9px; /* Pill shape for fill */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align text to the right of the filled bar */
    color: #fff;
    font-size: 0.8em;
    font-weight: 500;
    padding-right: 8px; /* Padding for the percentage text */
    transition: width 0.5s ease-out; /* Smooth transition for bar width */
}

/* Gender specific bar colors (optional, based on image hints) */
.bar-item:nth-child(1) .bar span { /* Male */
    background-color: #4285F4; /* Google Blue */
}
.bar-item:nth-child(2) .bar span { /* Female */
    background-color: #EA4335; /* Google Red */
}
.bar-item:nth-child(3) .bar span,
.bar-item:nth-child(4) .bar span,
.bar-item:nth-child(5) .bar span,
.bar-item:nth-child(6) .bar span { /* Age groups */
    background-color: #34A853; /* Google Green */
}


.birthdays {
    flex: 2; /* Takes 40% width roughly */
    min-width: 280px; /* Minimum width to prevent crushing */
    background-color: #ffffff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.birthdays .item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.birthdays .item:hover {
    background-color: #f0f2f5;
    transform: translateY(-2px);
}

.birthdays .item strong {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.birthdays .item small {
    color: #777;
    font-size: 0.9em;
}

.birthdays .item div { /* For phone number */
    color: #555;
    font-size: 0.95em;
    margin-top: 5px;
}

/* Login and Register Page Specific Styles */
/* Centering the card for login/register pages */
body.login-register-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5; /* Consistent with dashboard background */
}

/* Override .content margin for login/register pages */
body.login-register-body .content {
    margin-left: 0;
    padding: 0; /* No padding needed as card itself has padding */
    flex-grow: 0; /* Do not grow to take full width */
}

/* Card specific for login/register */
body.login-register-body .card {
    width: 100%;
    max-width: 400px; /* Max width for the login/register card */
    margin: 20px; /* Add some margin for smaller screens */
    padding: 0; /* Padding is handled by inner elements */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Slightly more prominent shadow for auth cards */
}

.card-header {
    background-color: #007bff; /* Primary blue for header */
    color: #ffffff;
    padding: 30px 25px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%; /* Circular logo */
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3); /* White border for logo */
}

.card-header h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 10px;
}

.card-header p {
    font-size: 1em;
    opacity: 0.9;
}

/* Base form styling for login/register (column layout) */
/* This style block applies to <form> elements not nested inside .form-container */
form {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.form-group { /* Keep this for login/register if needed, but not add_member.php */
    margin-bottom: 15px;
}

.form-group label { /* Keep this for login/register if needed, but not add_member.php */
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.95em;
}

/* General input/select/textarea styling for all forms */
/* These common styles should apply to inputs inside any form, including .form-container */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%; /* All inputs fill their container */
    padding: 0.5rem; /* Matches your on-page css */
    border: 1px solid #ddd;
    border-radius: 4px; /* Matches your on-page css */
    font-family: 'Inter', sans-serif;
    font-size: 1em; /* Kept consistent */
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-top: 0.25rem; /* From your on-page css */
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

textarea { /* Specific style for textareas */
    resize: vertical; /* Allow vertical resizing */
    min-height: 80px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -10px; /* Pull it closer to the input */
    margin-bottom: 15px;
    font-size: 0.9em;
}

.form-footer label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-weight: 400;
}

.form-footer input[type="checkbox"] {
    margin-right: 5px;
}

.form-footer a {
    color: #007bff;
    transition: text-decoration 0.2s ease;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Adjust btn style for login/register form */
/* Note: This applies to generic .btn inside any form.
   add_member.php's button will be specifically styled below */
form .btn {
    width: 100%;
    padding: 15px; /* Make it slightly larger */
    font-size: 1.1em;
    margin-top: 10px;
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.25);
}

form .btn:hover {
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.35);
}

.toggle-link {
    display: block;
    text-align: center;
    padding: 15px 25px;
    background-color: #f8f9fa; /* Light background for the link area */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    color: #007bff;
    font-size: 0.95em;
    transition: background-color 0.2s ease;
}

.toggle-link:hover {
    background-color: #e9ecef;
}

/* General Error Message Style (from login/register) - adjusted for .msg.error */
p[style="color:red;"] {
    display: none; /* Hide this old inline style */
}


/* --- START: Styles for add_member.php from your on-page CSS --- */

/* New: Top Bar specific to add_member.php */
.top-bar {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 5px; /* Added to separate from .form-container */
    /* Adjust content margin if sidebar is present to align with top-bar */
    margin-left: 250px; /* Aligns with content area for sidebar layout */
    border-radius: 12px; /* Consistent rounded corners */
}
.top-bar .user {
    font-weight: 500;
    color: #333; /* Ensuring consistent text color */
}
.top-bar a {
    color: #2e8b57;
    text-decoration: none;
    font-weight: bold;
    transition: text-decoration 0.2s ease;
}
.top-bar a:hover {
    text-decoration: underline;
}
.top-bar2 a {
    color: #2e8b57;
    text-decoration: none;
    font-weight: bold;
    transition: text-decoration 0.2s ease;
}
.top-bar2 a:hover {
    text-decoration: underline;
}

/* Form Container for Add Member */
.form-container {
    background: #fff;
    padding: 2rem;
    max-width: 1000px;
    margin: 2rem auto; /* Center and provide vertical spacing */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.form-container h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.8em; /* Keeping consistent with dashboard h2 */
    color: #333; /* Keeping consistent */
    font-weight: 600; /* Keeping consistent */
}

/* Message Styles for add_member.php (Overridden and harmonized) */
.msg {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: bold;
    padding: 12px 20px; /* From previous version, good for messages */
    border-radius: 8px; /* From previous version */
}
.msg.success {
    color: #155724; /* Adjusted from green to a specific color */
    background-color: #d4edda; /* Light green background */
    border: 1px solid #c3e6cb;
}
.msg.error {
    color: #721c24; /* Adjusted from red to a specific color */
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c6cb;
}

/* Two-column grid for add_member.php form */
.form-container form {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Force two columns as per your on-page CSS */
    gap: 1rem 2rem; /* Vertical and horizontal gap */
    padding: 0; /* Important: remove any default form padding */
}
.form-container label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    color: #555; /* Consistent with other labels */
    font-size: 0.95em; /* Consistent with other labels */
}

/* Full-width rows (e.g., Address) */
.full-width {
    grid-column: 1 / -1; /* Spans all columns */
}
/* Action row for the submit button */
.actions-row {
    grid-column: 1 / -1; /* Spans all columns */
    text-align: right; /* Aligns button to the right as per your on-page css */
    margin-top: 1rem; /* Space above button */
}
/* Style the button inside actions-row directly */
.actions-row button {
    background-color: #28a745; /* Green for submit */
    color: #ffffff;
    padding: 12px 20px; /* Consistent with other buttons */
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
    width: auto; /* Ensure it's not 100% width unless forced by media query */
    min-width: 150px; /* Give it a minimum width */
    display: inline-flex; /* Use inline-flex for centering content inside */
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.actions-row button:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}


/* Faded style for disabled labels/inputs */
.faded { opacity: 0.5; }

/* --- END: Styles for add_member.php from your on-page CSS --- */


/* --- Styles for members.php (from previous versions, kept for completeness) --- */

.page-header {
    background: linear-gradient(160deg, #2e8b57, #8bc34a); /* Green gradient from image */
    color: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.stats-cards {
    display: flex;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stats-cards .card {
    flex: 1;
    min-width: 200px;
    color: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stats-cards .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--card-color-start), var(--card-color-end));
    border-radius: 15px;
    z-index: 1;
    opacity: 0.9;
}
.stats-cards .card > * {
    position: relative;
    z-index: 2;
}

.stats-cards .card .icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.stats-cards .card strong {
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.stats-cards .card small {
    font-size: 1em;
    opacity: 0.9;
    color: #fff;
}

.stats-cards .card.purple {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    flex: 2;
    background: linear-gradient(135deg, #9C27B0, #4A148C);
}

.stats-cards .card.purple .btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: none;
}

.stats-cards .card.purple .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


.filters {
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 1rem 2rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.filters input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filters input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}


.member-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 2rem 2rem;
}

.member-table thead {
    background: #f8f9fa;
}

.member-table th, .member-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.95em;
}

.member-table th {
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.member-table tbody tr:last-child td {
    border-bottom: none;
}

.member-table tbody tr:hover {
    background-color: #f0f2f5;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell i {
    margin-right: 0.5rem;
    cursor: pointer;
    color: #555;
    font-size: 1.1em;
    transition: color 0.2s ease, transform 0.2s ease;
}

.actions-cell i:last-child {
    margin-right: 0;
}

.actions-cell i:hover {
    color: #000;
    transform: scale(1.1);
}

.member-table td[colspan="6"] {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}
    /* Custom styles for the pie chart container */
    .chart-container {
        position: relative;
        width: 100%;
        max-width: 400px; /* Adjust as needed */
        margin: 20px auto; /* Center the chart */
    }

    .chart-center-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        font-size: 1.2em;
        font-weight: bold;
        color: #333;
        pointer-events: none; /* Allow clicks to pass through to canvas */
    }

    .chart-center-text .percentage {
        font-size: 1.8em;
        color: #B8860B; /* Primary gold color */
    }

    /* Styles for the Last 10 Bookings table */
    .booking-details-table-container {
        background-color: #ffffff;
        padding: 25px;
        border-radius: 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        margin-top: 20px; /* Space from previous section */
    }

    .booking-details-table-container h4 {
        font-size: 1.3em;
        color: #333;
        margin-bottom: 25px;
        font-weight: 600;
    }

    .booking-details-table {
        width: 100%;
        border-collapse: collapse;
    }

    .booking-details-table th,
    .booking-details-table td {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
        text-align: left;
        white-space: nowrap; /* Prevent text wrapping in cells */
        font-size: 14px;
    }

    .booking-details-table th {
        background-color: #f8f9fa;
        font-weight: 600;
        color: #555;
        text-transform: uppercase;
        font-size: 0.85em;
        letter-spacing: 0.5px;
    }

    .booking-details-table tbody tr:last-child td {
        border-bottom: none;
    }

    .booking-details-table tbody tr:hover {
        background-color: #f0f2f5;
    }

    .status-badge {
        display: inline-block;
        padding: 5px 10px;
        border-radius: 5px;
        font-size: 0.8em;
        font-weight: bold;
        text-transform: uppercase;
        color: #fff;
    }

    .status-badge.confirmed { background-color: #28a745; } /* Green */
    .status-badge.booked { background-color: #007bff; } /* Blue */
    .status-badge.cancelled { background-color: #dc3545; } /* Red */
    .status-badge.completed { background-color: #6c757d; } /* Gray */
    .status-badge.paid { background-color: #28a745; } /* Green */
    .status-badge.not-paid { background-color: #ffc107; } /* Orange/Yellow */
    .status-badge.partially { background-color: #ff8c00; } /* Dark Orange for Partially */
    .status-badge.checked.in { background-color: #17a2b8; } /* Info Blue/Teal */
    .status-badge.checked.out { background-color: #6f42c1; } /* Purple */
    .status-badge.not.shown { background-color: #fd7e14; } /* Dark Orange */


    .table-actions {
        display: flex;
        gap: 8px;
    }

    .table-actions .action-btn {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 1.1em;
        padding: 5px;
        border-radius: 5px;
        transition: background-color 0.2s ease;
    }

    .table-actions .action-btn.edit {
        color: #007bff;
    }
    .table-actions .action-btn.edit:hover {
        background-color: #e0f2ff;
    }

    .table-actions .action-btn.delete {
        color: #dc3545;
    }
    .table-actions .action-btn.delete:hover {
        background-color: #f8d7da;
    }

    /* Responsive adjustments for table */
    @media (max-width: 768px) {
        .booking-details-table-container {
            padding: 15px;
        }
        .booking-details-table th,
        .booking-details-table td {
            padding: 8px 10px;
            font-size: 0.85em;
        }
        .status-badge {
            padding: 3px 6px;
            font-size: 0.7em;
        }
    }

/* --- Responsive adjustments --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .content {
        margin-left: 200px;
        padding: 15px;
    }
    .header, .actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .date-filter, .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    /* Removed the specific cards grid-template-columns for 1024px, now handled by the main .cards rule */
    .main-content {
        flex-direction: column;
    }
    .demographics, .birthdays {
        flex: none;
        width: 100%;
    }
    .bar-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .bar-item label {
        flex-basis: auto;
    }
    .bar {
        width: 100%;
    }
    .stats-cards .card {
        min-width: unset;
        width: 100%;
        flex: none;
    }
    .stats-cards .card.purple {
        min-height: unset;
    }
    .member-table, .filters {
        margin: 0 0 15px 0;
        border-radius: 8px;
    }
    .member-table th, .member-table td {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .actions-cell i {
        margin-right: 8px;
        font-size: 1em;
    }
    /* add_member.php adjustments */
    .top-bar { /* Adjusted margin for top-bar on smaller screens with sidebar */
        margin-left: 200px;
        padding: 1rem 15px;
        border-radius: 8px;
    }
    .form-container {
        padding: 1.5rem;
        margin: 1.5rem auto; /* Adjusted margin */
    }
}

@media (min-width: 769px) { /* Two columns for form in add_member.php */
    .form-container form {
        grid-template-columns: 1fr 1fr; /* Explicitly two columns */
    }
}


@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding-bottom: 0;
        box-shadow: none;
        border-bottom: 1px solid #eee;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .sidebar .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    .sidebar a {
        padding: 8px 10px;
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    .content {
        margin-left: 0;
        padding-top: 15px;
    }
    .cards { /* Adjusted for 1 column on mobile */
        grid-template-columns: 1fr;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    /* Login/Register Specific */
    body.login-register-body .card {
        margin: 15px;
    }
    .form-container {
        border-radius: 8px;
        margin: 1rem; /* Adjust margin for very small screens */
        max-width: none; /* Allow it to take full width */
    }
    .form-container h2 {
        font-size: 1.6em; /* Smaller title on mobile */
    }
    /* add_member.php form goes to single column here */
    .form-container form {
        grid-template-columns: 1fr; /* Force single column */
        gap: 1rem; /* Adjust gap for single column */
    }
    /* Top-bar also becomes single-line on mobile, without sidebar margin */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 15px;
        margin-left: 0; /* Remove sidebar margin */
    }
    .top-bar .user {
        width: 100%;
        text-align: center;
    }
    .top-bar a {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }
    .user-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .user-menu a {
        width: 100%;
    }
    .sidebar {
        padding: 10px;
    }
    .sidebar a {
        flex-basis: calc(50% - 10px); /* Two columns for navigation */
        margin: 5px;
        text-align: center;
        justify-content: center;
    }
    /* Login/Register Specific */
    .card-header {
        padding: 20px 15px;
    }
    form {
        padding: 20px;
    }
    .page-header {
        padding: 20px;
        border-radius: 8px;
    }
    .stats-cards {
        gap: 10px;
    }
    .filters {
        padding: 15px;
    }
    .filters input[type="text"] {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    .member-table th, .member-table td {
        padding: 8px 10px;
    }
    /* add_member.php adjustments */
    .form-container h2 {
        font-size: 1.5em;
    }
    /* Button inside actions-row */
    .actions-row button {
        padding: 12px 20px;
        font-size: 1em;
    }
}

/* Custom styles for the grid and booking blocks */
.calendar-grid-container {
    overflow-x: auto; /* Enable horizontal scrolling for the grid */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    /* Removed background-color here, it will be on the inner grid */
}
.calendar-grid {
    display: grid;
    /* The first column is for room names, the next 14 are for dates */
    grid-template-columns: 200px repeat(14, minmax(100px, 1fr));
    min-width: 1400px; /* Minimum width to ensure columns don't collapse too much */
    gap: 1px; /* This creates the grid lines */
    background-color: #e5e7eb; /* This is the color of the grid lines (gray-200) */
    border-radius: 0.5rem; /* Apply to the grid itself */
    overflow: hidden; /* Ensures rounded corners are respected */
}
.calendar-header-cell,
.calendar-room-cell,
.timeline-cell-bg { /* calendar-date-cell-background is now timeline-cell-bg */
    padding: 0.5rem; /* p-2 */
    text-align: center;
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    background-color: #ffffff; /* All cells within the grid are white */
    min-height: 4rem; /* h-16 */
    /* No individual borders needed, as gap handles lines */
}

.calendar-header-cell {
    background-color: #f9fafb; /* gray-50 */
    font-weight: 600; /* font-semibold */
    color: #4b5563; /* gray-700 */
}
.calendar-room-cell {
    background-color: #ffffff; /* bg-white */
    font-weight: 600;
    text-align: left;
    padding-left: 1rem; /* pl-4 */
    position: sticky;
    left: 0;
    z-index: 10;
    align-items: flex-start;
    justify-content: center;
}
.calendar-room-cell.unassigned {
    background-color: #fef3c7; /* light yellow for unassigned */
    color: #92400e; /* darker text */
}
.calendar-header-cell.today {
    background-color: #eff6ff; /* blue-100 */
    color: #1d4ed8; /* blue-700 */
    font-weight: 700; /* font-bold */
}

/* New container for bookings within each room row */
.room-bookings-timeline {
    position: relative; /* Crucial for absolute positioning of booking blocks */
    display: grid; /* This inner grid will hold the background cells and booking blocks */
    grid-template-columns: repeat(14, minmax(100px, 1fr)); /* Matches the main grid date columns */
    /* No gap, no background here. The main grid handles the lines */
    min-height: 4rem; /* h-16, same as calendar-date-cell-background */
    box-sizing: border-box;
    /* Borders are now handled by the main grid's gap and individual cell backgrounds */
    /* This div itself will span 14 columns of the main grid */
}
/* Style for the individual background cells within the timeline */
.room-bookings-timeline .timeline-cell-bg {
    background-color: #ffffff; /* Background for individual date cells within the timeline */
    min-height: 4rem; /* h-16 */
    box-sizing: border-box;
    /* No borders here, the outer grid's gap provides the lines */
}


.booking-block {
    position: absolute; /* Positioned relative to .room-bookings-timeline */
    height: calc(100% - 8px); /* Full height minus padding */
    margin: 4px; /* Give some margin from the top/bottom of the cell */
    /* The left and width will be set dynamically by PHP using grid-column */
    padding: 0.25rem; /* p-1 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    color: white; /* text-white */
    font-size: 0.75rem; /* text-xs */
    z-index: 5; /* Ensure booking blocks are above grid lines */
}
/* Colors for booking statuses */
.status-booked { background-color: #f97316; } /* orange-500 */
.status-checked-in { background-color: #22c55e; } /* green-500 */
.status-checked-out-red { background-color: #ef4444; } /* red-500 for checked out */
.status-cancelled { background-color: #ef4444; } /* red-500 */
.status-default { background-color: #3b82f6; } /* blue-500 */

/* Tailwind-like utility classes for grid spanning */
.col-span-full {
    grid-column: 1 / -1; /* Spans across all columns of its parent grid */
}
.col-span-14 {
    grid-column: span 14 / span 14; /* Spans 14 columns of its parent grid */
}

/* Existing styles from calendar - Copy.php (adjusted for Tailwind compatibility if needed) */
.sidebar { /* ... your existing sidebar styles ... */ }
.header { /* ... your existing header styles ... */ }
.actions { /* ... your existing actions styles ... */ }
.date-filter-form {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    align-items: center;
    gap: 10px;
}
.date-filter-form input[type="text"],
.date-filter-form select {
    padding: 8px 12px;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    flex-grow: 1; /* Allow inputs to grow */
    min-width: 150px; /* Minimum width for inputs */
}
.btn-filter {
    background-color: #3b82f6; /* blue-500 */
    color: white;
    padding: 8px 16px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}
.btn-filter:hover {
    background-color: #2563eb; /* blue-600 */
}
.user-menu {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    align-items: center;
    gap: 15px;
}
.user-menu a {
    color: #4b5563; /* gray-700 */
    text-decoration: none;
    transition: color 0.2s;
}
.user-menu a:hover {
    color: #1f2937; /* gray-900 */
}
.btn {
    background-color: #4b5563; /* gray-700 */
    color: white;
    padding: 8px 16px;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.btn:hover {
    background-color: #1f2937; /* gray-900 */
}
.btn.active {
    background-color: #10b981; /* green-500 */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 120px repeat(14, minmax(60px, 1fr)); /* Smaller room column on mobile */
        min-width: 1000px; /* Still need a minimum width for horizontal scroll */
    }
    .calendar-header-cell,
    .calendar-room-cell,
    .timeline-cell-bg { /* calendar-date-cell-background is now timeline-cell-bg */
        font-size: 0.7rem;
        padding: 0.3rem;
    }
    .calendar-room-cell {
        padding-left: 0.5rem;
    }
    .header, .actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .date-filter-form, .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .room-bookings-timeline {
        grid-template-columns: repeat(14, minmax(60px, 1fr)); /* Match main grid on mobile */
    }
}
