@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

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

body {
    /* Deep Blue Gradient Background */
    background: linear-gradient(135deg, #0b132b 0%, #1c2541 50%, #0b132b 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    color: #e0e6ed; /* Light gray text for readability on dark backgrounds */
}

/* Dark Glassmorphism Base */
.glass-panel {
    background: rgba(28, 37, 65, 0.45); /* Semi-transparent dark blue */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5); /* Harder shadow for depth */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle bright border */
    border-radius: 15px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 95vh;
    margin: 2.5vh 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.menu ul {
    list-style: none;
}

.menu ul li {
    margin-bottom: 10px;
}

.menu ul li a {
    text-decoration: none;
    color: #bac4d6; /* Muted light blue/gray */
    font-weight: 500;
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    transition: 0.3s;
}

.menu ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.menu-group {
    margin-left: 15px;
    font-size: 0.9em;
    display: none;
}

.menu ul li:hover .menu-group {
    display: block;
}

.sidebar-bottom {
    text-align: center;
    color: #bac4d6;
    font-size: 0.85em;
}

.logout-btn {
    background: rgba(231, 76, 60, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: 0.3s;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 1);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Main Content */
.main-content {
    flex: 1;
    margin: 2.5vh 15px 2.5vh 0;
    padding: 25px;
    overflow-y: auto;
    height: 95vh;
}

.main-content h1, .main-content h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Dashboard Tiles */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 1.1em;
    font-weight: 400;
    color: #bac4d6;
    margin-bottom: 8px;
}

.card .value {
    font-size: 2em;
    font-weight: 600;
    color: #4facfe; /* Neon blue pop for numbers */
    text-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
}

/* Forms */
.form-section {
    padding: 25px;
    margin-top: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
    color: #bac4d6;
}

/* Inputs, Selects, and Textareas */
input, select, textarea {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25); /* Darkened input background */
    color: #ffffff;
    outline: none;
    transition: 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: #4facfe;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(79, 172, 254, 0.3);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Select Dropdown options specifically for dark mode */
select option {
    background: #1c2541; 
    color: #ffffff;
}

/* Dynamic Table */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.invoice-table th {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    color: #bac4d6;
    font-weight: 500;
}

.invoice-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Base button reset to ensure <a> and <button> look identical */
.btn {
    display: inline-block;
    padding: 5px 10px;
    font-size: 0.85em;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    font-family: inherit;
}

/* View Button - Dark Blue (Matches your theme) */
.btn-view {
    background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
    color: #bac4d6;
}
.btn-view:hover {
    color: #fff;
    background: linear-gradient(135deg, #112240 0%, #1a365d 100%);
}

/* Edit Button - Professional Orange */
.btn-edit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
}
.btn-edit:hover {
    opacity: 0.9;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3);
}

/* Delete Button - Danger Red */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.3);
}

/* Totals Section */
.totals-section {
    float: right;
    width: 300px;
    margin-top: 20px;
    padding: 20px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    align-items: center;
    color: #bac4d6;
}

.totals-row strong {
    color: #ffffff;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Autocomplete Dropdown Styles (Dark Theme) */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(28, 37, 65, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-list li {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    color: #e0e6ed;
    transition: 0.2s;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #4facfe;
    font-weight: 500;
}

/* Custom Scrollbar for Dark Mode */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #112240; /* Match your dark blue theme */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #bac4d6;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Ensure buttons stay in a neat row */
td.actions {
    white-space: nowrap;
}

