/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --lab-color: #7c3aed;
    --lab-light: #ede9fe;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--gray-100) 100%);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
}

/* Header */
.header {
    text-align: center;
    padding: 24px 0;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.app-header {
    text-align: left;
    padding: 16px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.header-top h1 {
    font-size: 1.5rem;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.welcome-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.cohort-text {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 2px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

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

.card-header-row h2 {
    margin-bottom: 0;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select {
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-message {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-top: 8px;
}

.form-message.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.form-message.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Toggle Switch */
.toggle-group {
    padding: 8px 0;
}

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

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--gray-300);
    border-radius: 13px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

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

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-success:hover {
    background: #15803d;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.875rem;
}

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

.btn-secondary:hover {
    background: #d97706;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn-group .btn {
    flex: 1;
}

/* Demo Mode Styles */
.demo-mode-card {
    text-align: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px dashed var(--warning);
}

.demo-mode-card .btn {
    margin-bottom: 8px;
}

.demo-info {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

.demo-banner {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.demo-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.demo-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.demo-text {
    font-size: 0.95rem;
}

.demo-role-switcher {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px;
    border-radius: 6px;
}

.btn-demo-role {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

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

.btn-demo-role.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.demo-banner .btn {
    background: white;
    color: var(--warning);
    border: none;
}

.demo-banner .btn:hover {
    background: var(--gray-100);
}

/* Progress Bars */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.progress-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.progress-bar-lab .progress-fill,
.progress-fill-lab {
    background: linear-gradient(90deg, var(--lab-color) 0%, #6d28d9 100%);
}

/* Hours Remaining */
.hours-remaining {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.remaining-item {
    text-align: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.remaining-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.remaining-item:last-child .remaining-value {
    color: var(--lab-color);
}

.remaining-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Clock Status */
.clock-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-out {
    background: var(--gray-400);
    animation: none;
}

.status-in {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Clock-Out Recommendation */
.clock-out-recommendation {
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary);
}

.rec-icon {
    font-size: 1.2rem;
}

.recommendation-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.recommendation-option {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

@media (min-width: 480px) {
    .recommendation-option {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
}

.recommendation-option:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.recommendation-option.primary {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    font-weight: 600;
}

.rec-option-label {
    color: var(--gray-800);
    font-size: 0.95rem;
    font-weight: 500;
}

.recommendation-option.primary .rec-option-label {
    color: var(--primary-dark);
    font-weight: 600;
}

.rec-option-time {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

@media (min-width: 480px) {
    .rec-option-time {
        align-items: flex-end;
        text-align: right;
    }
}

.rec-option-time strong {
    font-size: 1.05rem;
    color: var(--primary-dark);
    font-weight: 600;
    white-space: nowrap;
}

.rec-option-hours {
    font-size: 0.85rem;
    color: var(--gray-700);
    font-weight: 500;
    white-space: nowrap;
}

.recommendation-note {
    font-size: 0.8rem;
    color: var(--gray-700);
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* Reminder Steps */
.reminder-card {
    background: linear-gradient(135deg, var(--warning-light) 0%, white 100%);
    border-left: 4px solid var(--warning);
}

.reminder-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.reminder-steps a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.reminder-steps a:hover {
    text-decoration: underline;
}

.reminder-steps small {
    color: var(--gray-500);
}

/* Entries List */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-entries {
    text-align: center;
    color: var(--gray-400);
    padding: 20px;
    font-size: 0.9rem;
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.entry-item.lab-entry {
    border-left-color: var(--lab-color);
    background: var(--lab-light);
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.entry-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.entry-time {
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rounding-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    position: relative;
}

.rounding-info svg {
    stroke: var(--gray-400);
    transition: stroke 0.2s;
}

.rounding-info:hover svg,
.rounding-info:active svg {
    stroke: var(--primary);
}

/* Custom tooltip that works on mobile too */
.rounding-info::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: pre-line;
    line-height: 1.4;
    min-width: 180px;
    max-width: 250px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    margin-bottom: 6px;
}

.rounding-info::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-800);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.rounding-info:hover::after,
.rounding-info:hover::before,
.rounding-info.show-tooltip::after,
.rounding-info.show-tooltip::before {
    opacity: 1;
    visibility: visible;
}

.entry-type {
    font-size: 0.75rem;
    color: var(--lab-color);
    font-weight: 500;
}

.entry-hours {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.entry-item.lab-entry .entry-hours {
    color: var(--lab-color);
}

.entry-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-icon.delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Admin Specific Styles */
.admin-link-card {
    text-align: center;
    background: var(--gray-50);
}

.admin-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-link:hover {
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Box */
.search-box {
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Filter Row */
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
}

/* Apprentices List */
.apprentices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.apprentice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.apprentice-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apprentice-name {
    font-weight: 600;
    color: var(--gray-800);
}

.apprentice-id {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.apprentice-cohort {
    font-size: 0.7rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
    width: fit-content;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cohorts List */
.cohorts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cohort-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.cohort-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cohort-name {
    font-weight: 600;
    color: var(--gray-800);
}

.cohort-details {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.cohort-details span {
    margin-right: 12px;
}

/* Admin Users List */
.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    gap: 12px;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.admin-user-name {
    font-weight: 600;
    color: var(--gray-800);
}

.admin-user-email {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.admin-user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.current-user-badge {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    padding: 4px 8px;
    background: var(--primary-light);
    border-radius: 4px;
}

.section-description {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: -8px 0 12px 0;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.info-text {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.help-text {
    margin-top: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.help-text ol {
    margin: 8px 0 0 20px;
    padding: 0;
}

.help-text li {
    margin: 4px 0;
}

@media (prefers-color-scheme: dark) {
    .admin-user-item,
    .admin-user-name,
    .cohort-name,
    .apprentice-name {
        color: var(--gray-100);
    }
    
    .section-description,
    .admin-user-email,
    .cohort-details,
    .apprentice-id {
        color: var(--gray-400);
    }
    
    .badge-success {
        background: #166534;
        color: #dcfce7;
    }
    
    .badge-info {
        background: #1e40af;
        color: #dbeafe;
    }
    
    .info-text {
        background: rgba(30, 64, 175, 0.2);
        color: #93c5fd;
    }
    
    .help-text {
        background: rgba(31, 41, 55, 0.5);
    }
}

/* Time Logs List */
.time-logs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.log-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.log-item.lab-entry {
    border-left-color: var(--lab-color);
    background: var(--lab-light);
}

.log-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.log-details {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.log-details .rounding-info {
    margin-left: 2px;
}

.log-hours {
    font-weight: 700;
    color: var(--primary);
}

.log-item.lab-entry .log-hours {
    color: var(--lab-color);
}

/* Summary Table */
.summary-section {
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.table-responsive {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.summary-table th,
.summary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.summary-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-table tbody tr:hover {
    background: var(--gray-50);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-complete {
    background: var(--success-light);
    color: var(--success);
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-ahead {
    background: var(--primary-light);
    color: var(--primary);
}

.status-behind {
    background: var(--danger-light);
    color: var(--danger);
}

/* Pace Indicator */
.pace-indicator {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pace-indicator.pace-complete {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: #166534;
}

.pace-indicator.pace-ahead {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: #1e40af;
}

.pace-indicator.pace-pending {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    color: #92400e;
}

.pace-indicator.pace-behind {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: #991b1b;
}

.pace-icon {
    font-size: 1.25rem;
}

.pace-text {
    flex: 1;
}

.pace-status {
    font-weight: 600;
    margin-bottom: 2px;
}

.pace-explanation {
    font-size: 0.85rem;
    opacity: 1;
}

.pace-help {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--gray-400);
    text-align: center;
    line-height: 1.8;
}

.pace-help .status-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    vertical-align: middle;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-small {
    max-width: 360px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.btn-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-buttons {
    margin-top: 20px;
}

.warning-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Messages */
.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 0.9rem;
}

.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 0.9rem;
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 0.9rem;
}

.message.success {
    background: var(--success-light);
    color: var(--success);
}

.message.error {
    background: var(--danger-light);
    color: var(--danger);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
}

.footer p {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.footer .footer-requirements {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.footer .made-with-love {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.footer .version {
    font-size: 0.7rem;
    color: var(--gray-300);
    margin-top: 4px;
    font-family: monospace;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Pay Period Display */
.pay-period {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Responsive - Tablet & Desktop */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
        padding: 24px 40px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 24px 32px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .main-grid .summary-card {
        grid-column: span 2;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        padding: 32px 60px;
    }

    .card {
        padding: 28px 40px;
    }

    .stats-grid {
        gap: 24px;
    }

    .main-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .main-grid .summary-card {
        grid-column: span 3;
    }
}

/* Admin Controls Bar */
.admin-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-user-email {
    font-size: 14px;
    color: var(--gray-700);
    margin-right: auto;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .admin-controls {
        background: rgba(31, 41, 55, 0.6);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .admin-user-email {
        color: var(--gray-300);
    }
}

/* Admin Panel Grid */
.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .admin-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .admin-full-width {
        grid-column: span 2;
    }
}

@media (min-width: 1200px) {
    .admin-grid {
        gap: 24px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-300: #6b7280;
        --gray-400: #9ca3af;
        --gray-500: #d1d5db;
        --gray-600: #e5e7eb;
        --gray-700: #f3f4f6;
        --gray-800: #f9fafb;
        --gray-900: #ffffff;
    }

    body {
        background: linear-gradient(135deg, #1e3a5f 0%, #111827 100%);
    }

    .card {
        background: #1f2937;
    }

    .form-group input,
    .form-group select,
    .search-box input,
    .filter-group select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .modal-content {
        background: #1f2937;
    }

    .reminder-card {
        background: linear-gradient(135deg, #422006 0%, #1f2937 100%);
    }

    /* Fix entry readability in dark mode */
    .entry-item,
    .log-item {
        background: rgba(37, 99, 235, 0.15);
    }

    .entry-item .entry-time,
    .entry-item .entry-date {
        color: #f9fafb;
    }

    .log-item .log-name,
    .log-item .log-details {
        color: #f9fafb;
    }

    /* Lab entries get purple background */
    .entry-item.lab-entry,
    .log-item.lab-entry {
        background: rgba(124, 58, 237, 0.15);
    }

    /* Tooltip dark mode fix - use fixed colors */
    .rounding-info::after {
        background: #1f2937;
        color: #f9fafb;
    }

    .rounding-info::before {
        border-top-color: #1f2937;
    }

    .log-item.lab-entry .log-name,
    .log-item.lab-entry .log-details {
        color: #f9fafb;
    }

    .entry-item.lab-entry .entry-time,
    .entry-item.lab-entry .entry-date {
        color: #f9fafb;
    }

    /* Clock-out recommendation dark mode */
    .clock-out-recommendation {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
        border-color: rgba(37, 99, 235, 0.5);
    }

    .recommendation-header {
        color: #60a5fa;
    }

    .recommendation-option {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(75, 85, 99, 0.5);
        color: #f9fafb;
    }

    .recommendation-option:hover {
        border-color: #60a5fa;
        background: rgba(37, 99, 235, 0.15);
    }

    .recommendation-option.primary {
        background: rgba(37, 99, 235, 0.25);
        border-color: #60a5fa;
    }

    .rec-option-label,
    .rec-option-time,
    .rec-option-hours,
    .rec-option-range {
        color: #f9fafb;
    }

    .recommendation-note {
        color: #d1d5db;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* Punch Confirmation Modal */
.punch-success {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
}

.punch-success p {
    font-size: 1.1rem;
    color: var(--gray-700);
}

.popup-steps {
    margin: 16px 0 24px;
}

.popup-steps li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.popup-steps li:last-child {
    border-bottom: none;
}

.popup-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.popup-link:hover {
    text-decoration: underline;
}

.step-done {
    background: var(--success) !important;
}

/* Tutorial Modal */
.tutorial-body {
    max-height: 70vh;
    overflow-y: auto;
}

.tutorial-step {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

.tutorial-step:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.tutorial-step h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.tutorial-step p {
    color: var(--gray-600);
    margin-bottom: 8px;
    line-height: 1.5;
}

.tutorial-step ul,
.tutorial-step ol {
    margin-left: 20px;
    color: var(--gray-600);
}

.tutorial-step li {
    margin-bottom: 6px;
    line-height: 1.4;
}
/* Tabs */
.tabs-container {
    padding: 0;
    margin-bottom: 8px;
}

.tabs {
    display: flex;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 14px;
    background: var(--gray-100);
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:first-child {
    border-top-left-radius: var(--radius);
}

.tab-btn:last-child {
    border-top-right-radius: var(--radius);
}

.tab-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Success Message */
.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.9rem;
    border: 1px solid var(--success);
}

/* Settings Modal */
.settings-intro {
    color: var(--gray-600);
    margin-bottom: 20px;
    line-height: 1.5;
}

.settings-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--gray-800);
}

.settings-help {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.schedule-day {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-day label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.schedule-input {
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    width: 100%;
}

.schedule-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.schedule-summary {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-700);
}

.schedule-summary strong {
    color: var(--gray-900);
}

.warning-text {
    color: var(--warning);
    font-size: 0.85rem;
    display: block;
    margin-top: 6px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}
