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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.nav-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.section {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section.active {
    display: block;
}

.week-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.week-selector button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.week-selector button:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

#week-picker {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

#week-display {
    font-weight: 600;
    font-size: 18px;
    color: #2c3e50;
    min-width: 200px;
    text-align: center;
}

.time-grid-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.time-grid {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.time-grid th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.employee-header {
    min-width: 150px;
    text-align: left !important;
    padding-left: 20px !important;
}

.time-grid td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.employee-name {
    font-weight: 600;
    text-align: left !important;
    padding-left: 20px !important;
    background: #f8f9fa;
    min-width: 150px;
}

.status-cell {
    padding: 4px;
    min-width: 120px;
}

.status-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.status-entered {
    background: #28a745;
    color: white;
}

.status-entered:hover {
    background: #218838;
    transform: scale(1.05);
}

.status-empty {
    background: #6c757d;
    color: white;
}

.status-empty:hover {
    background: #545b62;
    transform: scale(1.05);
}

.status-not-entered {
    background: #dc3545;
    color: white;
}

.status-not-entered:hover {
    background: #c82333;
    transform: scale(1.05);
}

.status-incorrect {
    background: #fd7e14;
    color: white;
}

.status-incorrect:hover {
    background: #e8680d;
    transform: scale(1.05);
}

/* Authentication required styles */
.status-btn.requires-auth {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.status-btn.requires-auth:hover {
    transform: none;
    opacity: 0.7;
}

.status-btn.requires-auth:after {
    content: '🔒';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.analytics-header h2 {
    color: #2c3e50;
    font-size: 2em;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.date-range-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.date-preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-preset:hover {
    border-color: #667eea;
    color: #667eea;
}

.btn-preset.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
}

.date-separator {
    font-weight: 600;
    color: #495057;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.empty {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    color: white;
}

.stat-card.not-entered {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.stat-card.entered {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stat-card.incorrect {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    color: white;
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-value {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.3em;
    flex-shrink: 0;
}

.chart-card canvas {
    flex: 1;
    max-height: 320px !important;
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 30px;
    color: #2c3e50;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#auth-form input {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: #fd7e14;
    color: white;
}

.btn-warning:hover {
    background: #e96d00;
    transform: translateY(-2px);
}

.error-message {
    color: #dc3545;
    margin-top: 15px;
    font-weight: 600;
}

.success-message {
    color: #28a745;
    margin-top: 15px;
    font-weight: 600;
}

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

.management-header h2 {
    color: #2c3e50;
}

.add-employee-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.add-employee-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

#add-employee-form {
    display: flex;
    gap: 15px;
    align-items: end;
}

#employee-name {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.employees-list h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.employee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.employee-item:hover {
    transform: translateX(5px);
    transition: transform 0.3s ease;
}

.employee-item span {
    font-weight: 600;
    color: #2c3e50;
}

.employee-buttons {
    display: flex;
    gap: 10px;
}

.employee-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.settings-management {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.settings-management h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.setting-item label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 200px;
}

.setting-input {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.setting-input:focus {
    outline: none;
    border-color: #667eea;
}

.credential-management {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.credential-management h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.credential-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.credential-fields input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.credential-fields input:focus {
    outline: none;
    border-color: #667eea;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.danger-zone {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid #dc3545;
}

.danger-zone h3 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.danger-warning {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    font-weight: 600;
}

.danger-action {
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    background: #fff5f5;
}

.danger-action h4 {
    color: #dc3545;
    margin-bottom: 10px;
}

.danger-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    font-size: 16px;
    margin: 15px 0;
    transition: border-color 0.3s ease;
}

.danger-input:focus {
    outline: none;
    border-color: #c82333;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.time-period-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.time-period-controls input[type="date"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #fd7e14;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.time-period-controls input[type="date"]:focus {
    outline: none;
    border-color: #e96d00;
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.25);
}

.time-period-controls span {
    color: #6c757d;
    font-weight: 600;
}

.danger-action + .danger-action {
    margin-top: 20px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 2px solid #dc3545;
    transition: all 0.3s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.app-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.app-info h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-item strong {
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.info-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.info-item a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .nav-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .week-selector {
        flex-direction: column;
        gap: 15px;
    }
    
    .analytics-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-buttons {
        justify-content: center;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        min-width: unset;
    }
    
    #add-employee-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .token-create-form .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .management-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* Share button styles */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-share svg {
    width: 16px;
    height: 16px;
}

/* Share toast notification */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: transform 0.3s ease;
    opacity: 0.95;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* API Tokens Section */
.api-tokens-section {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.token-create-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.token-create-form h4 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.token-create-form .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.token-create-form .form-row input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.token-create-form .form-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.token-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

.token-display h4 {
    color: #856404;
    margin-bottom: 10px;
}

.token-value {
    display: flex;
    gap: 10px;
    align-items: center;
}

.token-value input {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.existing-tokens {
    margin: 20px 0;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.token-info {
    flex: 1;
}

.token-info strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.token-info small {
    color: #666;
    font-size: 12px;
}

.token-actions {
    display: flex;
    gap: 10px;
}

.api-docs-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.api-docs-info h4 {
    color: #0d47a1;
    margin-bottom: 10px;
}

.code-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.code-inline code {
    background: #37474f;
    color: #4fc3f7;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    flex: 1;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.empty-tokens {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}