:root {
    --bg-color: #0B111E;
    --panel-bg: rgba(15, 23, 42, 0.75);
    --panel-border: rgba(59, 130, 246, 0.15);
    --text-main: #E5E7EB;
    --text-muted: #94a3b8;

    --primary: #1D4ED8;
    --primary-hover: #2563EB;
    --primary-glow: 0 4px 14px rgba(29, 78, 216, 0.25);

    --status-red: rgba(239, 68, 68, 0.2);
    --status-red-border: rgba(239, 68, 68, 0.5);
    --status-red-text: #fca5a5;

    --status-yellow: rgba(234, 179, 8, 0.2);
    --status-yellow-border: rgba(234, 179, 8, 0.5);
    --status-yellow-text: #fde047;

    --status-green: rgba(34, 197, 94, 0.2);
    --status-green-border: rgba(34, 197, 94, 0.5);
    --status-green-text: #86efac;

    --danger: #ef4444;
    --warning: #eab308;
    --success: #22c55e;

    --steel-dark: #1E40AF;
    --steel-mid: #1D4ED8;
    --steel-light: #2563EB;
    --slate-deep: #1E293B;
}

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

body {
    background-color: #0B111E;
    background-image: linear-gradient(135deg, #0B111E 0%, #111827 50%, #1F2937 100%);
    /* Night Blue & Cyber Neon */
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

.screen.hidden {
    display: none !important;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    z-index: 90;
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.4); /* Darker, more premium feel */
    backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    padding: 3rem 1rem;
    transition: all 0.3s ease;
}

#login-screen.active ~ .sidebar {
    display: none;
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-sidebar {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85); /* More readable */
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.05rem; /* Larger font */
    font-weight: 600; /* Bolder */
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.btn-sidebar:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
}

.btn-sidebar svg {
    width: 28px; /* Larger icons */
    height: 28px;
}

.btn-sidebar .icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-sidebar .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    font-size: 0.75rem;
}

/* Todo View Styles */
.todo-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.todo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.todo-date {
    font-size: 0.9rem;
    color: #ffffff; /* High contrast white */
    font-weight: 600;
}

.todo-actions {
    margin-bottom: 1.5rem;
}

.todo-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 5px;
}

.todo-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.todo-item.done {
    opacity: 0.5;
}

.todo-item.done .todo-title {
    text-decoration: line-through;
}

.todo-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.todo-title {
    font-size: 0.85rem;
    color: white;
    font-weight: 500;
    line-height: 1.4;
}

.todo-checkbox-wrapper {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.todo-checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 2;
}

.custom-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
}

.todo-checkbox-wrapper:hover input ~ .custom-checkmark {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.todo-checkbox-wrapper input:checked ~ .custom-checkmark {
    background-color: var(--success);
    border-color: var(--success);
}

.custom-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.todo-checkbox-wrapper input:checked ~ .custom-checkmark:after {
    display: block;
}

.todo-checkbox-wrapper input:disabled ~ .custom-checkmark {
    opacity: 0.5;
    cursor: not-allowed;
}

.todo-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8); /* Lighter white */
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 0.5rem;
}

.todo-reminder {
    color: #fbbf24; /* Warning yellow for visibility */
    font-weight: 500;
}

.todo-timestamp {
    color: var(--success);
    font-weight: 600;
}

.todo-list::-webkit-scrollbar {
    width: 4px;
}
.todo-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Screen Layout Adjustment */
#dashboard-screen, #performance-screen {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center contents in the right area */
}

#login-screen {
    z-index: 100;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

h1, h2, h3, h4 {
    color: #fff;
    font-weight: 600;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-block {
    width: 100%;
}

/* Inputs */
.input-group {
    margin-bottom: 0.8rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary);
}

.input-group textarea {
    width: 100%;
    padding: 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
    resize: none;
}

.error-text {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Login Screen */
#login-screen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #06090F 0%, #0B111E 40%, #0F1D2E 70%, #07192B 100%);
}

.login-panel {
    width: 100%;
    max-width: 380px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(11, 17, 30, 0.80);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 32px;
    color: #E5E7EB;
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.5), 0 4px 24px rgba(29, 78, 216, 0.1);
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #FFFFFF;
    font-size: 1.5rem;
}

.login-header p {
    color: #94a3b8;
}

.login-panel .input-group label {
    color: #94a3b8;
    font-weight: 500;
}

.btn-login {
    background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
    /* Corporate Steel Blue */
    color: #FFFFFF;
    font-size: 1.1rem;
    padding: 0.8rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
    transition: all 0.25s ease;
    letter-spacing: 0.4px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.forgot-password {
    margin-top: 1.5rem;
}

.forgot-password a {
    color: #60A5FA;
    /* Soft blue link */
    text-decoration: underline;
    font-size: 0.95rem;
}

/* Dashboard Topbar */
#dashboard-screen {
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1000;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    margin-right: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #1E293B;
    border: 1px solid #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #93C5FD;
}

/* Search and Filter Group */
.search-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: white;
    transition: background 0.3s;
    flex-grow: 1;
    min-width: 120px;
    max-width: 250px;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    margin-left: 0.5rem;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    min-width: 80px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.status-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    color: white;
    outline: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    max-width: 200px;
    text-overflow: ellipsis;
}

.status-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
}

.status-dropdown:focus {
    border-color: var(--primary);
}

.status-dropdown option {
    background: #1e293b;
    color: white;
}

/* Profile Dropdown */
.dropdown-wrapper {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    min-width: 220px;
    z-index: 1000;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    background: #1e293b; /* Dark solid background to ensure contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
    transform-origin: top right;
}

.profile-dropdown .btn-ghost {
    color: #f8fafc !important; /* Force high contrast white text */
    justify-content: flex-start;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
    width: 100%;
}

.profile-dropdown .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 35px; /* Adjust arrow to align better with profile area */
    width: 12px;
    height: 12px;
    background: #1e293b;
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Content & Table */
.dashboard-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem 2rem 1rem;
}

.table-container {
    padding: 1.5rem;
    overflow-x: auto;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-header {
    margin-bottom: 1.5rem;
}

.table-container th {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
}

.table-container td {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Table row border radii */
td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Status Colors */
tr.status-red td {
    background: var(--status-red);
    border-top: 1px solid var(--status-red-border);
    border-bottom: 1px solid var(--status-red-border);
}

tr.status-red td:first-child {
    border-left: 1px solid var(--status-red-border);
}

tr.status-red td:last-child {
    border-right: 1px solid var(--status-red-border);
}

tr.status-yellow td {
    background: var(--status-yellow);
    border-top: 1px solid var(--status-yellow-border);
    border-bottom: 1px solid var(--status-yellow-border);
}

tr.status-yellow td:first-child {
    border-left: 1px solid var(--status-yellow-border);
}

tr.status-yellow td:last-child {
    border-right: 1px solid var(--status-yellow-border);
}

tr.status-green td {
    background: var(--status-green);
    border-top: 1px solid var(--status-green-border);
    border-bottom: 1px solid var(--status-green-border);
}

tr.status-green td:first-child {
    border-left: 1px solid var(--status-green-border);
}

tr.status-green td:last-child {
    border-right: 1px solid var(--status-green-border);
}

tr.status-canceled td {
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8 !important; /* Lighter gray for better readability */
}

tr.status-canceled td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

tr.status-canceled td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

tr.status-red .status-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--status-red-text);
}

tr.status-yellow .status-badge {
    background: rgba(234, 179, 8, 0.2);
    color: var(--status-yellow-text);
}

tr.status-green .status-badge {
    background: rgba(34, 197, 94, 0.2);
    color: var(--status-green-text);
}

tr.status-canceled .status-badge {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 480px;
    max-height: 90vh;
    z-index: 101;
    padding: 1.2rem;
    animation: zoomIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close:hover {
    color: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.justify-center {
    justify-content: center;
}

.mt-4 {
    margin-top: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.border-t {
    border-top: 1px solid var(--panel-border);
}

/* Customer Details */
.customer-info-box h2 {
    margin-bottom: 1rem;
}

.customer-info-box p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #cbd5e1;
}

/* Action Buttons Styling */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.action-buttons .btn {
    border-radius: 12px;
    padding: 0.7rem 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

#btn-action-complete {
    grid-column: span 2;
    margin-top: 0.4rem;
    padding: 1rem;
    font-size: 1rem;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-buttons .btn-primary {
    background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.action-buttons .btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
}

.action-buttons .btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1000;
}

.action-buttons .btn-danger {
    background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    color: white;
}

.action-buttons .btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-buttons .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
}

.note-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #cbd5e1;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Performance Screen Styles */
.performance-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem;
    width: 95%;
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.history-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.history-column h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-left: 0.8rem;
    border-left: 4px solid var(--primary);
    color: white;
}

.history-table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    max-height: 250px; /* Limits to ~4 rows */
    overflow-y: auto;
    border: 1px solid var(--panel-border);
}

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

.history-table th {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-main);
}

.history-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-orange { color: #60A5FA !important; }

/* Scrollbar */
.history-table-wrapper::-webkit-scrollbar {
    width: 6px;
}
.history-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .history-sections {
        grid-template-columns: 1fr;
    }
}

/* Product Dropdown UI Styles */
.product-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.product-trigger {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: border-color 0.2s;
}

.product-trigger:hover {
    border-color: var(--primary);
}

.product-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.product-selection-container {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.2s ease;
}

.product-search-box {
    padding: 0.6rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.product-search-box input {
    width: 100% !important;
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: #f8fafc !important;
}

.product-list-wrapper {
    max-height: 180px;
    overflow-y: auto;
    padding: 0.4rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.85rem;
    color: #333;
}

.product-item:hover {
    background: #f1f5f9;
}

.product-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Admin Screen Styles */
.admin-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1300px;
    margin-top: 1rem;
    height: calc(100vh - 120px);
}

.employee-list-panel {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
}

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    overflow-y: auto;
}

.employee-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.employee-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.employee-card.active {
    background: var(--primary);
    border-color: var(--primary);
}

.employee-card .avatar-circle {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.employee-card.active .avatar-circle {
    background: rgba(255, 255, 255, 0.3);
}

.employee-info h4 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.employee-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.employee-stats-panel {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.placeholder-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-stats-grid {
    margin-bottom: 2rem;
}

.admin-stats-grid .stat-card {
    padding: 1.5rem;
}

.admin-stats-grid .stat-value {
    font-size: 1.8rem;
}

/* Ensure history tables fit in admin view */
.history-table-wrapper {
    max-height: 400px;
}

#admin-screen {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 2rem 1.5rem;
}

@media (max-width: 1100px) {
    .admin-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .employee-list-panel {
        height: 300px;
    }
}

/* Detailed Analysis Modal Styles */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.analysis-card h3 {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-container {
    width: 100%;
    position: relative;
    height: 250px;
}

.analysis-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.insight-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.insight-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.insight-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.insight-text h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.insight-text p {
    margin: 0.2rem 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.text-positive { color: #22c55e !important; }
.text-negative { color: #ef4444 !important; }

.chart-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container h4 {
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

#btn-detailed-analysis:hover {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.4) !important;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    .analysis-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0;
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }
}

/* Employee Management Styles */
.employee-mgmt-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.employee-mgmt-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.employee-mgmt-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.employee-mgmt-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.employee-mgmt-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-delete-employee {
    color: #ef4444;
    opacity: 0.6;
    transition: all 0.3s;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-delete-employee:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

#emp-code {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    padding: 1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
}

#emp-code:focus {
    border-color: var(--primary);
}

.verification-status {
    padding: 0.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.verification-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.verification-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Toast Notification Card */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-card {
    min-width: 300px;
    max-width: 450px;
    background: linear-gradient(135deg, rgba(11, 17, 30, 0.95) 0%, rgba(13, 27, 42, 0.98) 100%);
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.2), 0 4px 12px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-card.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-card.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.toast-info .toast-icon {
    color: #06b6d4;
}

/* Responsive Viewport Resizing Adjustments */
@media (max-width: 1150px) {
    .sidebar {
        width: 200px;
        padding: 2rem 0.5rem;
    }
    
    #dashboard-screen, #performance-screen, #admin-screen {
        margin-left: 200px;
        width: calc(100% - 200px);
        padding: 1.5rem 1rem;
    }
}

/* Ensure customer and history tables scroll horizontally on small widths */
.table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
}

.table-container table {
    width: 100%;
    min-width: 700px;
}

.history-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

.history-table {
    width: 100%;
    min-width: 500px;
}

/* Timeline Styles */
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.8rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #0B111E;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item.success::before {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}
.timeline-item.warning::before {
    background: var(--warning);
    box-shadow: 0 0 0 2px var(--warning);
}
.timeline-item.danger::before {
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--danger);
}
.timeline-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.2rem;
}
.timeline-content {
    background: rgba(255,255,255,0.03);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.timeline-content strong {
    color: white;
}