/* Custom Colors for Dark Theme */
:root {
    --color-dark-background: #222831; /* Deep Slate Gray */
    --color-container-background: #393E46; /* Charcoal Gray */
    --color-primary-accent: #6C63FF; /* Vibrant Purple-Blue */
    --color-secondary-accent: #00ADB5; /* Teal */
    --color-light-text: #EEEEEE; /* Light Grey */
    --color-subtle-border: #4A5568; /* Darker Grey */
    --color-input-background: #4F5D75; /* Even darker blue-gray for inputs */
    --color-display-background: #2D333B; /* Slightly lighter than container for displays */
    --color-button-normal: #50586B; /* General button background */
    --color-button-hover: #636D81; /* General button hover */
    --color-error-red: #EF4444; /* Existing Red */
}

/* --- New Particles.js Background Styles --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Keep it behind all content */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-dark-background); /* Pure background color */
    background-image: none; /* Removed old animated grid */
    animation: none; /* Removed old animation */
    position: relative; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: var(--color-light-text); /* Default text color */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* HIDDEN BY DEFAULT: Main app content container */
.app-container {
    background-color: var(--color-container-background);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25); /* Stronger shadow for contrast */
    width: 100%;
    max-width: 900px; /* Slightly wider for better spacing */
    min-height: 550px; /* Slightly taller */
    display: none; /* Default hidden state - only shown on successful login */
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative; 
    z-index: 2;
}

/* Top Bar & Navigation */
.top-bar {
    display: flex;
    justify-content: flex-start; /* Align tabs to start */
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--color-subtle-border);
    flex-wrap: wrap; /* Allow wrapping on very small screens if necessary */
    gap: 0.5rem; /* Space between buttons */
}
.nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Space between nav buttons */
}
.nav-button {
    padding: 10px 20px; /* Slightly reduced padding */
    border-radius: 10px; /* Rounded buttons */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking too much */
    font-size: 0.95rem; /* Slightly smaller font */
    background-color: var(--color-button-normal);
    color: var(--color-light-text);
    border: none; /* Remove default button border */
}
.nav-button.active {
    background-color: var(--color-primary-accent);
    color: white;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3); /* Soft shadow for active */
}
.nav-button:not(.active):hover {
    background-color: var(--color-button-hover);
}

.section-content {
    padding: 20px;
    flex-grow: 1;
    display: none;
    flex-direction: column;
    color: var(--color-light-text); /* Ensure section content text is light */
}
.section-content.active {
    display: flex;
}
.section-content h2 {
    color: var(--color-light-text); /* Heading text color */
}

/* Notepad Specific Styles */
#notepad-textarea {
    resize: vertical;
    min-height: 200px;
    max-height: 400px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background-color: var(--color-input-background);
    border: 1px solid var(--color-subtle-border);
    color: var(--color-light-text);
    padding: 1rem;
    border-radius: 8px;
    outline: none; /* Remove default outline */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle inner shadow */
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#notepad-textarea::placeholder {
    color: rgba(238, 238, 238, 0.6); /* Lighter placeholder text */
}
.notepad-buttons button {
    background-color: var(--color-primary-accent);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.2);
}
.notepad-buttons button:hover {
    background-color: #5C54D1; /* Darker primary accent on hover */
    transform: translateY(-2px);
}
.notepad-buttons button:active {
    transform: translateY(0);
}
/* Override for paste button to match new theme if needed */
#paste-button {
    background-color: var(--color-button-normal);
    color: var(--color-light-text);
    box-shadow: 0 4px 10px rgba(74, 85, 104, 0.2);
}
#paste-button:hover {
    background-color: var(--color-button-hover);
}


/* Calculator Specific Styles */
#calculator-display {
    background-color: var(--color-display-background);
    text-align: right;
    font-size: 3rem; /* Slightly larger font size */
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 20px;
    color: var(--color-light-text);
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3); /* Deeper inner shadow */
    transition: background-color 0.3s ease, color 0.3s ease;
}
.calc-button {
    background-color: var(--color-button-normal);
    color: var(--color-light-text);
    padding: 18px; /* Adjusted padding */
    border-radius: 12px;
    font-size: 1.6rem; /* Slightly larger font */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.calc-button:hover {
    background-color: var(--color-button-hover);
    transform: translateY(-2px);
}
.calc-button:active {
    transform: translateY(0);
}
.calc-button.operator {
    background-color: var(--color-primary-accent);
    color: white;
}
.calc-button.operator:hover {
    background-color: #5C54D1;
}
.calc-button.equals {
    background-color: var(--color-secondary-accent);
    color: white;
}
.calc-button.equals:hover {
    background-color: #008C94;
}
.calc-button.clear {
    background-color: var(--color-error-red);
    color: white;
}
.calc-button.clear:hover {
    background-color: #C23838; /* Darker red */
}

/* Goldsmiths Care Specific Styles (Updated to match newcalc.html structure) */
.product-care-calc {
    background-color: var(--color-container-background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0.625rem 1.5625rem rgba(0, 0, 0, 0.25);
    max-width: 28rem; /* Equivalent to max-w-md */
    width: 100%;
    color: var(--color-light-text); /* Ensure text is light */
    margin-left: auto; /* Added for centering */
    margin-right: auto; /* Added for centering */
}

.product-care-calc h2 {
    color: var(--color-light-text);
    font-size: 1.875rem; /* Equivalent to text-2xl */
    font-weight: 700; /* Equivalent to font-bold */
    text-align: center;
    margin-bottom: 1.5rem; /* Equivalent to mb-6 */
}

.product-care-calc p {
    color: var(--color-light-text); /* Ensure text is light */
    text-align: center;
    font-size: 1.125rem; /* Equivalent to text-lg */
}

.product-care-calc .relative {
    position: relative;
    display: flex;
    align-items: center;
}

.product-care-calc input[type="number"] {
    -webkit-appearance: none; /* For Chrome, Safari, Edge */
    -moz-appearance: textfield; /* For Firefox */
    margin: 0; /* Remove default margin */
    width: 100%;
    padding: 0.75rem 1rem; /* px-4 py-3 */
    border: 1px solid var(--color-subtle-border); /* border-gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    text-align: center;
    font-size: 1.125rem; /* text-lg */
    background-color: var(--color-input-background); /* bg-white */
    color: var(--color-light-text); /* text-gray-800 */
    outline: none;
    transition: all 0.2s ease-in-out;
}

.product-care-calc input[type="number"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-accent); /* focus:ring-2 focus:ring-blue-500 */
    border-color: var(--color-primary-accent);
}

.product-care-calc .relative i {
    position: absolute;
    right: 1rem; /* right-4 */
    color: rgba(238, 238, 238, 0.7); /* text-gray-500 */
    font-size: 1.125rem; /* text-lg */
}

#care-terms {
    display: flex;
    flex-direction: column; /* flex-col */
    border: 1px solid var(--color-subtle-border); /* border-gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    overflow: hidden;
}

@media (min-width: 640px) { /* sm: */
    #care-terms {
        flex-direction: row; /* sm:flex-row */
    }
}

#care-terms > div {
    flex: 1; /* flex-1 */
    text-align: center;
    border-bottom: 1px solid var(--color-subtle-border); /* border-b */
    background-color: var(--color-display-background); /* bg-white */
}

@media (min-width: 640px) { /* sm: */
    #care-terms > div {
        border-bottom: 0; /* sm:border-b-0 */
        border-right: 1px solid var(--color-subtle-border); /* sm:border-r */
    }
    #care-terms > div:last-child {
        border-right: 0; /* last:border-r-0 */
    }
}

#care-terms > div p {
    background-color: #4F5D75; /* bg-gray-50 */
    padding: 0.5rem; /* p-2 */
    color: var(--color-light-text); /* text-gray-600 */
    font-weight: 500; /* font-medium */
    border-bottom: 1px solid var(--color-subtle-border); /* border-b border-gray-300 */
}

#care-terms > div div {
    padding: 0.75rem; /* p-3 */
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: var(--color-primary-accent); /* text-gray-800, changed to accent */
}

/* Removed the specific text-sm style for the disclaimer */


/* Hide number input arrows (spinners) for all number inputs */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.no-spinners {
    -moz-appearance: textfield; /* Firefox */
}


/* Email Builder Styles */
.email-builder-control-group {
    background-color: var(--color-display-background);
    padding: 0.75rem 1rem; /* Reduced padding */
    border-radius: 10px;
    border: 1px solid var(--color-subtle-border);
}
.email-builder-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem; /* Reduced font size */
    font-weight: 500; /* Adjusted font weight */
}
.email-builder-options {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--color-subtle-border);
}
#email-preview-container {
    background-color: var(--color-display-background);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--color-subtle-border);
}
#email-preview {
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    min-height: 200px;
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-y: auto;
}
#copy-built-email-btn {
    background-color: var(--color-primary-accent);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.2);
    width: 100%;
}
#copy-built-email-btn:hover {
    background-color: #5C54D1;
    transform: translateY(-2px);
}
.email-builder-select {
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    border: 1px solid var(--color-subtle-border);
    border-radius: 8px;
    padding: 0.5rem;
    width: 100%;
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-button-normal);
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--color-primary-accent);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary-accent);
}

input:checked + .slider:before {
  -webkit-transform: translateX(22px);
  -ms-transform: translateX(22px);
  transform: translateX(22px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 28px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Custom message box for alerts */
.message-box-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Darker overlay */
    display: none; /* Hide by default using display */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; /* Keep for fade effect */
    visibility: hidden; /* Keep for fade effect */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.message-box-overlay.active {
    display: flex; /* Show when active */
    opacity: 1;
    visibility: visible;
}
.message-box-content {
    background: var(--color-container-background); /* Match app container */
    color: var(--color-light-text);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.message-box-overlay.active .message-box-content {
    transform: translateY(0);
}
.message-box-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--color-light-text);
}
.message-box-content p {
    font-size: 1rem;
    color: var(--color-light-text);
    margin-bottom: 25px;
}
.message-box-content button {
    background-color: var(--color-primary-accent);
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.message-box-content button:hover {
    background-color: #5C54D1;
}

/* Toast Notification Styles */
#toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent dark background */
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* Allows clicks to pass through */
}
#toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px); /* Slight lift effect */
}

/* Aftersales costs specific styles for tables */
.aftersales-table-container {
    background-color: var(--color-display-background);
    border: 1px solid var(--color-subtle-border);
    border-radius: 10px;
    overflow: hidden; /* Ensures rounded corners on table within */
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.aftersales-table-container h3 {
    background-color: #4F5D75; /* A slightly lighter shade for sub-headings */
    padding: 1rem;
    font-weight: 600;
    color: var(--color-light-text);
    border-bottom: 1px solid var(--color-subtle-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.aftersales-table {
    width: 100%;
    border-collapse: collapse;
}
.aftersales-table th, .aftersales-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-subtle-border);
    color: var(--color-light-text);
}
.aftersales-table th {
    background-color: var(--color-button-normal);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(238, 238, 238, 0.8);
}
.aftersales-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect */
}
.aftersales-table tbody tr:last-child td {
    border-bottom: none;
}
.aftersales-message {
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    color: rgba(238, 238, 238, 0.7);
}

.aftersales-search-input {
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    border: 1px solid var(--color-subtle-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    outline: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.aftersales-search-input::placeholder {
    color: rgba(238, 238, 238, 0.6);
}
.aftersales-search-input:focus {
    ring-2: var(--color-secondary-accent);
}

.aftersales-brand-section {
    margin-bottom: 2rem; /* Spacing between brand tables */
}

/* Watch Setting Functions specific styles */
#lunar-phase-container {
    background-color: var(--color-display-background);
    padding: 25px; /* Increased padding */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px; /* Increased max-width */
    width: 100%; /* Ensure it takes full available width up to max-width */
    margin: 0 auto; /* Center the container */
}

#lunar-phase-form {
    display: grid; /* Changed to grid */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive columns */
    gap: 20px; /* Increased gap */
    margin-bottom: 25px; /* Increased margin */
    width: 100%; /* Take full width of its container */
    align-items: end; /* Align items to the bottom of their grid area */
}

#lunar-phase-form > div {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center label and select horizontally */
    justify-content: flex-end; /* Align contents to the bottom */
    min-height: 80px; /* Ensures consistent height for each grid item */
}

#lunar-phase-form label {
    display: block; /* Ensure label behaves as a block element */
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-light-text);
    text-align: center;
    height: 24px; /* Fixed height for labels to align inputs */
    line-height: 24px; /* Center text vertically within label height */
}

#lunar-phase-form select {
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    height: 48px; /* Give it a fixed height to ensure consistency */
    width: 100%;
    padding: 12px; /* Increased padding */
    border-radius: 8px;
    border: 1px solid var(--color-subtle-border);
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

#lunar-phase-form select:focus {
    border-color: var(--color-primary-accent);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.5);
}

#lunar-phase-result {
    text-align: center;
    margin-top: 15px;
}

#moon-image {
    max-width: 250px; /* Slightly larger moon image */
    height: auto;
    border-radius: 50%; /* Make it circular */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Add shadow to moon image */
    transition: transform 0.3s ease;
}

#moon-image:hover {
    transform: scale(1.05);
}

#lunar-phase-message {
    color: var(--color-light-text);
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 1.2rem; /* Reserve space to prevent layout shift */
}

/* New styles for current date/time, GMT, and leap year sections */
.watch-setting-info-block {
    background-color: var(--color-display-background);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.watch-setting-info-block label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: var(--color-light-text);
}

.watch-setting-info-block select,
.watch-setting-info-block .display-text {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--color-subtle-border);
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    margin-top: 5px;
}

.watch-setting-info-block .display-text {
    background-color: var(--color-input-background);
    padding: 10px;
    font-weight: bold;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .app-container {
        padding: 15px;
        min-height: auto;
    }
    .top-bar {
        padding: 0.75rem;
        justify-content: center; /* Center tabs on small screens */
    }
    .nav-button {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
    .section-content {
        padding: 15px;
    }
    #calculator-display {
        font-size: 2.5rem;
    }
    .calc-button {
        padding: 15px;
        font-size: 1.4rem;
    }
    .goldsmiths-care-input {
        padding: 1rem 1.25rem;
        font-size: 1.2rem;
    }
    .email-template-item {
        padding: 1rem;
    }
    .email-template-text {
        font-size: 0.95rem;
    }
    #lunar-phase-form {
        grid-template-columns: 1fr; /* Stack on very small screens */
    }
    #lunar-phase-form > div {
        min-height: auto; /* Allow height to auto-adjust */
        justify-content: flex-start; /* Reset for stacked view */
    }
}

/* Password Protection Overlay Styles */
#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* FIX: Reverting to opaque background so main content is hidden */
    background: var(--color-dark-background); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Ensure it's on top of everything */
    transition: opacity 0.3s ease;
}

#password-overlay.hidden {
    display: none;
}

.password-prompt-box {
    /* Now using opacity for particles to show through password box, not the whole overlay */
    background: rgba(57, 62, 70, 0.95); 
    color: var(--color-light-text);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 450px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2001;
}

.password-prompt-box h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--color-primary-accent);
}

.password-prompt-box input[type="password"] {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--color-subtle-border);
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.password-prompt-box input[type="password"]:focus {
    border-color: var(--color-primary-accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.5);
}

.password-prompt-box button {
    background-color: var(--color-primary-accent);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
    width: 100%;
    max-width: 200px;
}

.password-prompt-box button:hover {
    background-color: #5C54D1;
    transform: translateY(-2px);
}

.password-prompt-box button:active {
    transform: translateY(0);
}

#password-error-message {
    color: var(--color-error-red);
    margin-top: 15px;
    font-size: 0.95rem;
    min-height: 20px; /* Reserve space to prevent layout shift */
}

/* Lunch Organiser Specific Styles */
.staff-input-group {
    background-color: var(--color-display-background);
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-columns: 1fr; /* Default for mobile */
    gap: 1rem;
}

@media (min-width: 640px) {
    .staff-input-group {
        /* Name + Category | Shift Start | Shift End | Remove Button */
        grid-template-columns: 1.5fr 1fr 1fr auto;
        align-items: center; /* Vertically align items in the grid */
    }
}

.staff-input-group label {
    font-weight: 500;
    color: var(--color-light-text);
    margin-bottom: 0.5rem;
    display: block; /* Ensure label takes its own line */
}

.staff-input-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--color-subtle-border);
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.staff-input-group input[type="text"]:focus {
    border-color: var(--color-primary-accent);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.5);
}

/* Slider specific styles */
.shift-time-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.shift-time-control input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--color-subtle-border);
    outline: none;
    border-radius: 5px;
    transition: opacity .2s;
}

.shift-time-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-accent);
    cursor: pointer;
    border: 2px solid var(--color-light-text);
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.shift-time-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-accent);
    cursor: pointer;
    border: 2px solid var(--color-light-text);
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.shift-time-display {
    font-weight: 600;
    color: var(--color-secondary-accent);
    text-align: center;
}


.category-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap; /* Allow wrapping */
    margin-top: 0.5rem; /* Space from shift inputs */
    justify-content: flex-start; /* Align buttons to the start */
}

.category-buttons button {
    flex: 0 0 auto; /* Do not grow, do not shrink, base on content */
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--color-button-normal);
    color: var(--color-light-text);
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.category-buttons button.active {
    background-color: var(--color-secondary-accent);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.category-buttons button:not(.active):hover {
    background-color: var(--color-button-hover);
}

.remove-staff-button {
    background-color: var(--color-error-red);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    align-self: center; /* Align to the center of its grid cell */
    width: 100%; /* Take full width of its grid cell */
    max-width: 100px; /* Limit max width for better appearance */
    margin-left: auto; /* Push to right if space allows */
    margin-right: auto; /* Center if no other elements push it */
}

@media (min-width: 640px) {
    .remove-staff-button {
        margin-top: 0; /* Reset margin on larger screens */
        width: auto; /* Allow button to size to content */
        max-width: none; /* Remove max-width constraint */
    }
}

#add-staff-button, #calculate-lunches-button {
    background-color: var(--color-primary-accent);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.2);
    width: fit-content; /* Adjust width to content */
    margin-right: 1rem; /* Space between buttons */
}

#add-staff-button:hover, #calculate-lunches-button:hover {
    background-color: #5C54D1;
    transform: translateY(-2px);
}

#lunch-results {
    background-color: var(--color-display-background);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem; /* Reduced margin */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#lunch-results p {
    font-size: 1.1rem;
    color: var(--color-light-text);
    display: flex;
    justify-content: space-between;
}

#lunch-results .penalty-warning {
    color: #FBBF24; /* Amber-400 */
    font-style: italic;
    font-size: 0.9rem;
    margin-left: 1rem;
}

#lunch-summary {
    font-size: 0.95rem;
    color: rgba(238, 238, 238, 0.8);
    border-top: 1px solid var(--color-subtle-border);
    padding-top: 1rem;
    margin-top: 1rem;
}

#lunch-error-message {
    color: var(--color-error-red);
    margin-bottom: 1rem; /* Changed from margin-top */
    text-align: center;
    font-weight: 600;
}

/* Finance Calculator Styles */
.finance-calculator-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.finance-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.finance-input {
    background-color: var(--color-input-background);
    color: var(--color-light-text);
    border: 1px solid var(--color-subtle-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}
.finance-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: var(--color-display-background);
    padding: 0.5rem;
    border-radius: 10px;
}
 .finance-toggle-container button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    background-color: transparent;
    color: var(--color-light-text);
    flex: 1;
    text-align: center;
}
.finance-toggle-container button.active {
    background-color: var(--color-primary-accent);
    color: white;
}
#finance-results {
    background-color: var(--color-display-background);
    padding: 1.5rem;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.finance-result-item {
    text-align: center;
}
.finance-result-item p {
    font-weight: 500;
    color: rgba(238, 238, 238, 0.8);
}
 .finance-result-item span {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-secondary-accent);
}

/* New styles for Finance Calculator Term Buttons */
.finance-term-container {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px; /* Space for scrollbar if visible */
    scrollbar-width: none; /* Firefox */
}
.finance-term-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
.finance-term-buttons {
    display: flex;
    gap: 0.75rem;
}
.finance-term-button {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--color-subtle-border);
    background-color: var(--color-button-normal);
    color: var(--color-light-text);
    flex-shrink: 0; /* Prevent buttons from shrinking */
}
.finance-term-button.active {
    background-color: var(--color-secondary-accent);
    color: white;
    border-color: var(--color-secondary-accent);
}
