body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container, .dashboard-container {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

h1, h2 {
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 1em;
}

label {
    display: block;
    margin-bottom: 0.5em;
    color: #555;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding and width */
}

button {
    width: 100%;
    padding: 0.8em;
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 1em;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

.error-message {
    color: #D8000C;
    background-color: #FFD2D2;
    padding: 0.8em;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 1em;
}

/* General container for the main content */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 1em auto;
    padding: 1em;
}

/* Header styles */
.header {
    background-color: #333;
    color: white;
    padding: 1em 2em;
    text-align: center;
}
.header h1 {
    margin: 0;
    color: white;
}
.header p {
    margin: 0;
    color: #ccc;
}
.header a {
    color: #00aaff;
    text-decoration: none;
}
.header a:hover {
    text-decoration: underline;
}

/* Flex container for forms */
.form-container {
    display: flex;
    gap: 2em;
    margin-bottom: 2em;
    flex-wrap: wrap;
}

/* Individual form cards */
.form-card {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 300px;
}
.form-card h2 {
    text-align: left;
    margin-top: 0;
    border-bottom: 2px solid #f4f4f9;
    padding-bottom: 0.5em;
}

/* Select dropdown styling */
select {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
}

/* Flex container for lists */
.lists-container {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
}

/* Individual list cards */
.list-card {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 300px;
}
.list-card h2 {
    text-align: left;
    margin-top: 0;
    border-bottom: 2px solid #f4f4f9;
    padding-bottom: 0.5em;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
th, td {
    padding: 0.8em;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* Success message styling */
.success-message {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    padding: 0.8em;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 1em;
}

/* Body adjustments for dashboard view */
body {
    height: auto;
    background-color: #f4f4f9;
    display: block;
}

.dashboard-container {
    margin: 1em auto;
}

/* Make a list card take full width if needed */
.list-card.full-width {
    flex: 1 1 100%;
}

.action-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.action-link:hover {
    text-decoration: underline;
}

/* Trip Details Page Specific Styles */
.trip-summary-card {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 2em;
}
.trip-summary-card h2 {
    margin-top: 0;
    border-bottom: 2px solid #f4f4f9;
    padding-bottom: 0.5em;
}

.profit-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}
.profit-item span {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 0.25em;
}
.profit-item strong {
    font-size: 1.5em;
}
.profit-item.income strong { color: #28a745; }
.profit-item.expense strong { color: #dc3545; }
.net-profit.positive strong { color: #28a745; }
.net-profit.negative strong { color: #dc3545; }

.content-split {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
}
.content-split .form-card,
.content-split .list-card {
    min-width: 300px;
    flex: 1;
}

/* Color for profit/loss text in tables */
.positive-text { color: #28a745; }
.negative-text { color: #dc3545; }

/* Main dashboard summary cards */
.main-summary {
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    margin-bottom: 2em;
    padding: 0 1em;
}
.main-summary .profit-item strong {
    font-size: 2em;
}

/* Filter card styling */
.filter-card {
    background-color: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 2em;
    border: 1px solid #eef;
}
.filter-card h3 {
    margin-top: 0;
}
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
}
.filter-actions {
    margin-top: 1.5em;
    display: flex;
    gap: 1em;
    align-items: center;
}
.filter-actions a {
    color: #555;
    text-decoration: none;
}
.filter-actions a:hover {
    text-decoration: underline;
}

/* This uses Flexbox to perfectly align items in the table cell */
.actions-cell {
    display: flex;
    align-items: center; /* Vertically aligns items to the middle */
    gap: 0.8em;          /* Creates a nice space between the links/button */
    white-space: nowrap; /* Prevents wrapping on smaller screens */
}

/* Styling for View and Edit links remains the same */
.action-link.view { color: #007bff; }
.action-link.edit { color: #ffc107; }

/* This makes the <button> look and feel exactly like an <a> link */
.action-link.delete {
    color: #dc3545;      /* Red color for delete */
    background: none;    /* No background */
    border: none;        /* No border */
    padding: 0;          /* No extra space inside */
    margin: 0;           /* No extra space outside */
    font-family: inherit;/* Use the same font as the table */
    font-size: inherit;  /* Use the same font size as the table */
    font-weight: bold;   /* Keep it bold to match other links */
    cursor: pointer;     /* Show a pointer on hover */
    line-height: 1;      /* Ensure it aligns vertically */
}

/* Add an underline on hover to complete the link-like appearance */
.action-link.delete:hover {
    text-decoration: underline;
}

/* --- NEW HEADER AND LOGO STYLES --- */

/* Make the header a flex container to position items */
.header {
    display: flex;
    justify-content: space-between; /* Puts space between left and right items */
    align-items: center;            /* Vertically aligns them */
    padding: 0.5em 2em;             /* Adjust padding */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1em; /* Space between logo and title */
}

.logo {
    height: 50px; /* You can adjust the height of your logo */
    width: auto;
}

/* Make header title smaller to fit logo */
.header h1 {
    font-size: 1.5em;
}

/* --- RESPONSIVE / MOBILE-FRIENDLY STYLES --- */

/* This media query targets all devices with a screen width of 768px or less */
@media (max-width: 768px) {
	
/* Find the old .main-summary rule inside the media query and REPLACE it with this: */

/* This will target the summary cards on BOTH the admin and trip details pages */
.profit-summary .profit-item strong {
    font-size: 0.8em; /* A better size for mobile */
}
.profit-summary .profit-item span {
    font-size: 0.3em;
}

/* You can remove the old .main-summary rules if they are still there */

    /* Make containers and text more mobile-friendly */
    .container {
        padding: 0.5em;
    }

    .header {
        flex-direction: column;
        padding: 0.5em;
        gap: 0.5em;
    }

    .header h1 {
        font-size: 1.2em;
    }
    
    /* Stack form sections vertically */
    .form-container,
    .content-split,
    .filter-group {
        flex-direction: column;
    }

    /* --- RESPONSIVE TABLE TRANSFORMATION --- */
    
    /* Hide the original table headers */
    table thead {
        display: none;
    }

    /* Make each table row a separate card */
    table tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 5px;
        margin-bottom: 1em;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* Make table cells stack vertically within their card */
    table td {
        display: block;
        text-align: right; /* Align the data to the right */
        border-bottom: 1px dotted #eee;
        padding-left: 50%; /* Make space for the label on the left */
        position: relative;
    }

    table td:last-child {
        border-bottom: none;
    }

    /* Use the data-label attribute to create a label on the left of each cell */
    table td:before {
        content: attr(data-label); /* The magic happens here */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        text-align: left;
        font-weight: bold;
    }

    /* Adjust action buttons for mobile layout */
    .actions-cell {
        padding-left: 10px; /* No need for 50% padding here */
        text-align: left;
    }

    .actions-cell:before {
        content: ""; /* Hide the label for the actions cell */
    }
}