:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    /* Blue */
    --success: #10b981;
    /* Green */
    --danger: #ef4444;
    /* Red */
    --red: #ef4444;
    --warning: #f59e0b;
    /* Yellow/Orange */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --nav-item-text: #64748b;
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.5);
    --input-text: white;
    --row-alt-bg: rgba(30, 41, 59, 0.4);
    --sidebar-bg: rgba(15, 23, 42, 0.8);
    --form-title-bg: #0f172a;
    --nav-header-text: rgba(255, 255, 255, 0.4);
    --nav-header-hover: rgba(255, 255, 255, 0.8);
    --bg-subtle: rgba(255, 255, 255, 0.03);
}

html.light-theme {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary: #2563eb;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --nav-item-text: #334155;
    --glass-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-text: #0f172a;
    --row-alt-bg: rgba(241, 245, 249, 0.6);
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --form-title-bg: #f8fafc;
    --nav-header-text: rgba(15, 23, 42, 0.5);
    --nav-header-hover: rgba(15, 23, 42, 0.8);
    --bg-subtle: rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Header */
.top-bar {
    width: 100%;
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--primary);
}

.current-time {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, height 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-muted);
}

/* Input Section */
.input-section {
    display: flex;
    gap: 1rem;
}

#badge-input {
    flex: 1;
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--input-text);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

#badge-input:focus {
    border-color: var(--primary);
}

.btn-badge-submit {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    width: 3.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-badge-submit:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-badge-submit:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Dynamic Actions */
.hidden {
    display: none !important;
}

.view-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease forwards;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--input-text);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    appearance: none;
    outline: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select optgroup {
    background: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
}

select option {
    background: var(--bg-color);
    color: var(--text-main);
}

.btn-action {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
    font-family: inherit;
    color: white;
}

.btn-action:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-green {
    background: var(--success);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-red {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-yellow {
    background: var(--warning);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-blue {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Dashboard Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.btn-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    background-size: 200% auto;
    font-family: inherit;
    height: 120px;
    width: 100%;
    /* Square-ish removed */
}

.btn-dashboard:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

.btn-dashboard:active {
    transform: scale(0.98);
}

.btn-dashboard svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.2rem;
    stroke-width: 2.5;
}

/* Gradients */
.btn-green {
    background-image: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-red {
    background-image: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.btn-yellow {
    background-image: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-blue {
    background-image: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-purple {
    background-image: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.btn-gray {
    background-image: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 4px 15px rgba(71, 85, 105, 0.3);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-decoration: underline;
    opacity: 0.7;
}

.btn-text:hover {
    opacity: 1;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    width: fit-content;
}

.status-indicator.working {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-indicator.break {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.pulse {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(currentColor, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(currentColor, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(currentColor, 0);
    }
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.info-row:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.info-row span:first-child {
    color: var(--text-muted);
}

/* Toast */
#notification-area {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #334155;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease forwards;
}

.toast.error {
    background: #ef4444;
}

.toast.success {
    background: #10b981;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Admin Grid Condensed */
#employee-list td,
#employee-list th {
    padding: 0.5rem 1rem !important;
}

#employee-list td img,
#employee-list td div {
    width: 30px !important;
    height: 30px !important;
}

/* Manage Hours Grid Customizations */
#hours-list tr td {
    padding: 0.4rem 0.8rem;
    vertical-align: middle;
}

#hours-list tr:nth-child(even) {
    background-color: var(--row-alt-bg);
    /* Alternating row color */
}

#hours-list tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.day-divider td {
    background-color: rgba(255, 255, 255, 0.1);
    height: 4px;
    padding: 0 !important;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--glass-border);
  -webkit-transition: .4s;
  transition: .4s;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

.toggle-switch input:checked + .slider {
  background-color: var(--success);
}

.toggle-switch input:focus + .slider {
  box-shadow: 0 0 1px var(--success);
}

.toggle-switch input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.toggle-switch .slider.round {
  border-radius: 34px;
}

.toggle-switch .slider.round:before {
  border-radius: 50%;
}

.emp-name-link {
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s, text-decoration 0.2s;
}

.emp-name-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Date input calendar icon for dark / light modes */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

html.light-theme input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
}

/* Custom Context Menu */
.context-menu {
    position: fixed;
    z-index: 10000;
    width: 150px;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    padding: 0.35rem 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.context-menu-item {
    padding: 0.6rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}