* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e6ed;
    min-height: 100vh;
}

/* Light mode */
body.light-mode {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
}

.container {
    background: rgba(30, 41, 59, 0.95);
    padding: 30px 40px 40px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .container {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Custom Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background: rgba(30, 41, 59, 0.98);
    color: #e0e6ed;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    
    /* Position */
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    
    /* Arrow */
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    /* Animation */
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(30, 41, 59, 0.98) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Light mode tooltip */
body.light-mode .tooltip .tooltip-text {
    background: rgba(255, 255, 255, 0.98);
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode .tooltip .tooltip-text::after {
    border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
}

/* Tooltip position modifiers */
.tooltip .tooltip-text.tooltip-bottom {
    bottom: auto;
    top: 125%;
}

.tooltip .tooltip-text.tooltip-bottom::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent rgba(30, 41, 59, 0.98) transparent;
}

body.light-mode .tooltip .tooltip-text.tooltip-bottom::after {
    border-color: transparent transparent rgba(255, 255, 255, 0.98) transparent;
}

.tooltip .tooltip-text.tooltip-left {
    bottom: auto;
    top: 50%;
    left: auto;
    right: 125%;
    transform: translateY(-50%);
}

.tooltip .tooltip-text.tooltip-left::after {
    top: 50%;
    left: 100%;
    right: auto;
    transform: translateY(-50%);
    border-color: transparent transparent transparent rgba(30, 41, 59, 0.98);
}

body.light-mode .tooltip .tooltip-text.tooltip-left::after {
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.98);
}

.tooltip .tooltip-text.tooltip-right {
    bottom: auto;
    top: 50%;
    left: 125%;
    transform: translateY(-50%);
}

.tooltip .tooltip-text.tooltip-right::after {
    top: 50%;
    left: auto;
    right: 100%;
    transform: translateY(-50%);
    border-color: transparent rgba(30, 41, 59, 0.98) transparent transparent;
}

body.light-mode .tooltip .tooltip-text.tooltip-right::after {
    border-color: transparent rgba(255, 255, 255, 0.98) transparent transparent;
}

.upper-container {
    padding: 16px 0px 10px 16px;
}

.login-overlay .upper-container {
    max-width: 450px;
    width: 90%;
    padding: 16px 10px 10px 16px;
}

h1 {
    color: #f1f5f9;
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0px;
    text-align: center;
    letter-spacing: -0.5px;
}

body.light-mode h1 {
    color: #1e293b;
}

.listening-indicator {
    background: rgba(71, 85, 105, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 20px auto;
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.receiving-indicator {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    color: #10b981;
    font-size: 0.85rem;
    display: none;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.receiving-indicator.show {
    display: flex;
    opacity: 1;
}

.receiving-indicator.fade-out {
    opacity: 0;
}

.receiving-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 1s infinite;
}

.receiving-ellipsis::after {
    content: '';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% {
        content: '.';
    }
    33% {
        content: '..';
    }
    66% {
        content: '...';
    }
    100% {
        content: '.';
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

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

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.mode-label {
    font-size: 14px;
    font-weight: 500;
    color: #e0e6ed;
}

body.light-mode .mode-label {
    color: #1e293b;
}

.mode-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: #4CAF50;
    border-radius: 24px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.mode-toggle input[type="checkbox"]:checked ~ .toggle-slider {
    background-color: #f44336;
}

.mode-toggle input[type="checkbox"]:checked ~ .toggle-slider::before {
    transform: translateX(24px);
}

button {
    font-family: inherit;
}

.archive-buttons {
    display: flex;
    gap: 12px;
}

.archive-btn {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 2px solid #60a5fa;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.light-mode .archive-btn {
    background: rgba(59, 130, 246, 0.35);
    color: #3b82f6;
    border-color: #3b82f6;
}

.archive-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #3b82f6;
}

body.light-mode .archive-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.25);
    border-color: #2563eb;
    color: #2563eb;
}

.archive-btn:disabled {
    background: rgba(71, 85, 105, 0.1);
    color: rgba(148, 163, 184, 0.7);
    border-color: rgba(148, 163, 184, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

body.light-mode .archive-btn:disabled {
    background: rgba(71, 85, 105, 0.1);
    color: rgba(148, 163, 184, 0.7);
    border-color: rgba(148, 163, 184, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.clear-btn {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 2px solid #94a3b8;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clear-btn:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.2);
    border-color: #64748b;
    color: #64748b;
}

.history-btn {
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 2px solid #94a3b8;
    display: flex;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 56.9965px;
    width: 56.9965px;
}

.history-btn:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.2);
    border-color: #64748b;
    color: #64748b;
}

.history-btn > svg {
    width: 30px;
    height: 30px;
}

.clear-btn:disabled {
    background: rgba(71, 85, 105, 0.1);
    color: rgba(148, 163, 184, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
    cursor: not-allowed;
}

.delete-icon {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.delete-icon:hover {
    background: rgba(239, 68, 68, 0.1);
}

.delete-icon svg {
    width: 20px;
    height: 20px;
    fill: #ef4444;
    transition: fill 0.3s ease;
}

.delete-icon:hover svg {
    fill: #dc2626;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(30, 41, 59, 0.98);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

body.light-mode .modal {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-title {
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

body.light-mode .modal-title {
    color: #1e293b;
}

.modal-message {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 32px;
    text-align: center;
}

body.light-mode .modal-message {
    color: #475569;
}

.modal-input-container {
    margin-bottom: 24px;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

body.light-mode .modal-input {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgb(92, 101, 114);
    color: #1e293b;
}

.modal-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(15, 23, 42, 0.8);
}

body.light-mode .modal-input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.9);
}

.modal-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

body.light-mode .modal-char-count {
    color: #64748b;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    min-width: 100px;
}

.modal-btn-confirm {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: #60a5fa;
}

.modal-btn-confirm:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #3b82f6;
}

.modal-btn-cancel {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: #94a3b8;
}

.modal-btn-cancel:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: #64748b;
    color: #64748b;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

body.light-mode .data-table {
    background: rgba(248, 250, 252, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.data-table th,
.data-table td {
    border: 1px solid rgba(71, 85, 105, 0.3);
    padding: 16px;
    text-align: left;
    font-size: 0.95rem;
}

body.light-mode .data-table th,
body.light-mode .data-table td {
    border-color: rgba(226, 232, 240, 0.8);
}

.data-table th:first-child {
    border-left: none;
}

.data-table th:last-child {
    border-right: none;
}

.data-table thead tr:first-child th {
    border-top: none;
}

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

.data-table td:first-child {
    border-left: none;
}

.data-table td:last-child {
    border-right: none;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 15%;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 15%;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 25%;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 10%;
    text-align: center;
}

.data-table th {
    background: #334155;
    font-weight: 600;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

body.light-mode .data-table th {
    background: #e2e8f0;
    color: #1e293b;
}

.data-table tbody tr {
    background: rgba(30, 41, 59, 0.6);
    transition: all 0.3s ease;
}

body.light-mode .data-table tbody tr {
    background: rgba(255, 255, 255, 0.6);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(51, 65, 85, 0.4);
}

body.light-mode .data-table tbody tr:nth-child(even) {
    background: rgba(241, 245, 249, 0.8);
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.2);
}

.data-table td {
    color: #cbd5e1;
}

body.light-mode .data-table td {
    color: #334155;
}

.data-table tbody td:nth-child(2) {
    font-weight: 500;
}

@keyframes swipeOut {
    0% {
        transform: translateX(0) scaleY(1);
        opacity: 1;
        max-height: 100px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    70% {
        transform: translateX(80%) scaleY(0.8);
        opacity: 0.3;
    }

    100% {
        transform: translateX(100%) scaleY(0);
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.archive-animation {
    animation: swipeOut 0.5s ease-in-out forwards;
    overflow: hidden;
}

@keyframes flashRow {
    0%, 100% {
        background: inherit;
    }
    50% {
        background: rgba(59, 130, 246, 0.4);
    }
}

body.light-mode .data-table tbody tr.flash-animation {
    animation: flashRowLight 0.6s ease-in-out;
}

@keyframes flashRowLight {
    0%, 100% {
        background: inherit;
    }
    50% {
        background: rgba(59, 130, 246, 0.3);
    }
}

.data-table tbody tr.flash-animation {
    animation: flashRow 0.6s ease-in-out;
}

/* Login Screen Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

body.light-mode .login-overlay {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background: rgba(30, 41, 59, 0.98);
    border-radius: 16px;
    padding: 48px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .login-container {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

.login-title {
    color: #f1f5f9;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.5px;
}

body.light-mode .login-title {
    color: #1e293b;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 32px;
}

body.light-mode .login-subtitle {
    color: #64748b;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

body.light-mode .form-label {
    color: #334155;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 1rem;
    transition: all 0.3s ease;
}

body.light-mode .form-input {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgb(92, 101, 114);
    color: #1e293b;
}

.form-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(15, 23, 42, 0.8);
}

body.light-mode .form-input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.9);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: rgba(71, 85, 105, 0.3);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

body.light-mode .password-toggle {
    background: rgba(226, 232, 240, 0.5);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.3);
}

.password-toggle:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5e1;
}

body.light-mode .password-toggle:hover {
    background: rgba(226, 232, 240, 0.8);
    color: #334155;
    border-color: rgba(100, 116, 139, 0.5);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 2px solid #60a5fa;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.light-mode .login-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: #3b82f6;
}

.login-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #3b82f6;
}

body.light-mode .login-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.25);
    border-color: #2563eb;
    color: #2563eb;
}

.login-btn:disabled {
    background: rgba(71, 85, 105, 0.1);
    color: rgba(148, 163, 184, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
    cursor: not-allowed;
}

body.light-mode .login-btn:disabled {
    background: rgba(226, 232, 240, 0.3);
    color: rgba(100, 116, 139, 0.5);
    border-color: rgba(148, 163, 184, 0.3);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
}

body.light-mode .login-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

.login-error.show {
    display: block;
}

.logout-btn {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 2px solid #94a3b8;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: #64748b;
    color: #64748b;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: rgba(71, 85, 105, 0.3);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 51.2px;
    height: 51.2px;
}

.help-button {
    background: rgba(71, 85, 105, 0.3);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 51.2px;
    width: 51.2px;
}

.help-button > svg {
    width: 24px;
    height: 24px;
}

.help-button:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
}

body.light-mode .help-button {
    background: rgba(226, 232, 240, 0.5);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.3);
}

body.light-mode .help-button:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(100, 116, 139, 0.5);
}

body.light-mode .theme-toggle {
    background: rgba(226, 232, 240, 0.5);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.3);
}

.theme-toggle:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
}

body.light-mode .theme-toggle:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(100, 116, 139, 0.5);
}

.theme-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.moon-icon {
    position: absolute;
    opacity: 1;
}

.sun-icon {
    position: absolute;
    opacity: 0;
}

body.light-mode .moon-icon {
    opacity: 0;
}

body.light-mode .sun-icon {
    opacity: 1;
}

.user-dropdown {
    position: relative;
}

.user-button {
    background: rgba(71, 85, 105, 0.3);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 6px 14px 6px 9px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

body.light-mode .user-button {
    background: rgba(226, 232, 240, 0.5);
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.3);
}

.user-button svg {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

#currentVendor {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

body.light-mode #currentVendor {
    color: #64748b;
}

.user-button:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
}

body.light-mode .user-button:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(100, 116, 139, 0.5);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

body.light-mode .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border-radius: 6px;
    margin: 4px;
}

body.light-mode .dropdown-item {
    color: #334155;
}

.dropdown-item:hover {
    background: rgba(71, 85, 105, 0.5);
    color: #e0e6ed;
}

body.light-mode .dropdown-item:hover {
    background: rgba(226, 232, 240, 0.7);
    color: #1e293b;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inactive-indicator {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.inactive-indicator.show {
    opacity: 1;
    visibility: visible;
}

.header-row h1,
.header-row h2 {
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.location-display {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(71, 85, 105, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 1.1rem;
    white-space: nowrap;
}

body.light-mode .location-display {
    background: rgba(226, 232, 240, 0.5);
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.4);
}

.custom-dropdown {
    position: relative;
    width: 100%;
    margin-top: 12px;
}

.custom-dropdown-selected {
    background: rgba(71, 85, 105, 0.3);
    color: #e0e6ed;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-dropdown-selected::after {
    content: '▼';
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.custom-dropdown-selected:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
}

.custom-dropdown.open .custom-dropdown-selected::after {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    text-align: left;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
}

.custom-dropdown-group-label {
    padding: 8px 16px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #60a5fa;
    background: rgba(71, 85, 105, 0.3);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.custom-dropdown-group-label:first-child {
    border-top: none;
}

.custom-dropdown-option {
    padding: 12px 16px 12px 32px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #e0e6ed;
    font-size: 1rem;
}

.custom-dropdown-option:hover {
    background: rgba(71, 85, 105, 0.5);
}

.custom-dropdown-option.selected {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Light mode styles */
body.light-mode .custom-dropdown-selected {
    background: rgba(226, 232, 240, 0.5);
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.4);
}

body.light-mode .custom-dropdown-selected:hover {
    background: rgba(226, 232, 240, 0.8);
}

body.light-mode .custom-dropdown-options {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .custom-dropdown-group-label {
    color: #3b82f6;
    background: rgba(226, 232, 240, 0.5);
    border-top-color: rgba(148, 163, 184, 0.3);
}

body.light-mode .custom-dropdown-option {
    color: #1e293b;
}

body.light-mode .custom-dropdown-option:hover {
    background: rgba(226, 232, 240, 0.7);
}

body.light-mode .custom-dropdown-option.selected {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.location-select optgroup {
    font-weight: bold;
    font-style: normal;
    color: #94a3b8;
}

body.light-mode .location-select optgroup {
    color: #64748b;
}

.location-select option {
    font-weight: normal;
    padding-left: 8px;
}

.location-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.location-error {
    display: none;
    color: #ef4444;
    font-size: 1.2rem;
    font-weight: 500;
    white-space: nowrap;
}

.location-error.show {
    display: block;
}

@keyframes flashError {
    0%, 100% {
        opacity: 1;
    }
    25% {
        opacity: 0.1;
    }
    50%, 75% {
        opacity: 1;
    }
}

.location-error.flash {
    animation: flashError 0.2s ease-in-out 2;
}

.main-app {
    display: none;
}

.main-app.active {
    display: block;
}

/* Unknown Tags Section */
.unknown-tags-section {
    margin-top: 30px;
}

.unknown-tags-toggle {
    width: 100%;
    background: rgba(71, 85, 105, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-align: left;
}

body.light-mode .unknown-tags-toggle {
    background: rgba(226, 232, 240, 0.5);
    border-color: rgba(148, 163, 184, 0.3);
    color: #1e293b;
}

.unknown-tags-toggle:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.5);
}

body.light-mode .unknown-tags-toggle:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(100, 116, 139, 0.5);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.unknown-tags-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.unknown-tags-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.unknown-tags-content.show {
    max-height: 2000px;
}

.unknown-tags-table {
    margin-top: 10px;
}

/* Image Modal */
.image-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    cursor: pointer;
}

.image-modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    transition: opacity 0.2s;
}

.image-modal-close:hover {
    opacity: 0.7;
}
