/* General Body & Theme */
body {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 40px 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Main Content Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px;
    background-color: #2c2c2c;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Headings */
h1, h2, h3 {
    color: #ffffff;
    margin-top: 0;
    font-weight: 500;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #b0b0b0;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 16px;
    box-sizing: border-box; /* Important for padding */
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-block;
    width: auto; /* Changed from 100% */
    padding: 12px 20px; /* Adjusted padding */
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Alerts and Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 16px;
}

.alert-danger {
    color: #f8d7da;
    background-color: #721c24;
    border-color: #f5c6cb;
}

.alert-success {
    color: #d4edda;
    background-color: #155724;
    border-color: #c3e6cb;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    color: #b0b0b0;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.btn-logout {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c82333;
    text-decoration: none;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background-color: #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-card h3 {
    margin-top: 0;
    font-size: 1em;
    color: #b0b0b0;
}

.summary-data {
    font-size: 2.2em;
    font-weight: bold;
    color: #ffffff;
    margin: 10px 0 0 0;
}

.main-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.nav-button {
    background-color: #007bff;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-button:hover {
    background-color: #0056b3;
    text-decoration: none;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.page-header h2 {
    margin: 0;
}

.page-header .btn, .page-header .btn-secondary {
    width: auto;
    display: inline-block;
    margin-left: 10px;
}

.btn-secondary {
    padding: 10px 15px;
    background-color: #5a6268;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #4a5056;
    text-decoration: none;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto; /* For responsiveness on small screens */
    background-color: #2c2c2c;
    border-radius: 8px;
    margin-top: 25px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
}

thead th {
    background-color: #333;
    color: #e0e0e0;
    font-weight: 500;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #383838;
}

tbody tr:last-child td {
    border-bottom: none;
}

td.actions {
    white-space: nowrap;
}

.action-btn {
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-right: 5px;
}

.action-btn.edit { background-color: #007bff; }
.action-btn.edit:hover { background-color: #0056b3; }
.action-btn.delete { background-color: #dc3545; }
.action-btn.delete:hover { background-color: #c82333; }
.action-btn.view { background-color: #17a2b8; }
.action-btn.view:hover { background-color: #138496; }


/* Status Badges */
.status-active, .status-paid, .status-clocked-in {
    color: #28a745;
    font-weight: bold;
}
.status-inactive, .status-clocked-out {
    color: #dc3545;
    font-weight: bold;
}
.status-draft { color: #ffc107; font-weight: bold; }
.status-sent { color: #007bff; font-weight: bold; }
.status-void { color: #6c757d; font-weight: bold; }


/* Form Layout */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-group.half-width {
    flex: 1;
}

/* Timesheets Page Styles */
.btn-small {
    padding: 5px 12px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success { background-color: #28a745; }
.btn-success:hover { background-color: #218838; }
.btn-danger { background-color: #dc3545; }
.btn-danger:hover { background-color: #c82333; }

.form-card {
    background-color: #2c2c2c;
    padding: 25px;
    border-radius: 8px;
    margin-top: 15px;
}

.message-container {
    min-height: 60px; /* Prevent layout shift when message appears */
    transition: opacity 0.5s;
}

/* Invoice Builder & Summary */
.summary-calculation {
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    margin-left: auto;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 1.1em;
    border-bottom: 1px solid #444;
}
.summary-row:last-child {
    border-bottom: none;
}
.summary-row.total {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    padding-top: 15px;
}
.form-inline {
    gap: 15px;
}

/* Styles for Report Action Buttons */
.report-actions {
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #333;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
}
.action-form {
    margin: 0;
}

.employee-timesheet-header {
    margin-top: 30px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    color: #00aaff; /* A highlight color to stand out */
}

.employee-table {
    margin-top: 0;
}

/* --- NEW DASHBOARD STYLES --- */

/* Expanded Summary Grid */
.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.summary-subtext {
    font-size: 0.6em;
    color: #b0b0b0;
    display: block;
    margin-top: -5px;
}
.summary-card.action-needed {
    background-color: #721c24; /* Red to draw attention */
    border: 1px solid #f5c6cb;
}
.summary-card.action-needed h3 {
    color: #f8d7da;
}

/* Main Content Area (Chart) */
.dashboard-main-content {
    margin-bottom: 30px;
}
.dashboard-widget {
    background-color: #2c2c2c;
    padding: 25px;
    border-radius: 8px;
}
.dashboard-widget h3 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 250px;
    padding: 10px;
    border-left: 1px solid #555;
    border-bottom: 1px solid #555;
}
.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 80px;
}
.chart-bar {
    width: 60%;
    background-color: #007bff;
    border-radius: 4px 4px 0 0;
    transition: background-color 0.3s;
    position: relative; /* For tooltip */
}
.chart-bar:hover {
    background-color: #0056b3;
}
.chart-label {
    margin-top: 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Tooltip for chart bars */
.chart-bar[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: #1a1a1a;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* Grouped Navigation */
.navigation-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.nav-group {
    background-color: #2c2c2c;
    padding: 25px;
    border-radius: 8px;
}
.nav-group h3 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.nav-group .nav-button {
    display: block; /* Make buttons stack vertically */
    width: 100%;
    margin-bottom: 10px;
}
.nav-group .nav-button:last-child {
    margin-bottom: 0;
}