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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

#login-screen {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 1000;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#login-screen.active {
    display: flex;
}

#main-screen {
    display: none;
}

#main-screen.active {
    display: block;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 35px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: slideUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-wrapper {
    margin-bottom: 20px;
    animation: fadeIn 0.6s ease-out 0.1s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.brand-logo {
    max-width: 140px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.welcome-title {
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.5px;
    animation: fadeIn 0.6s ease-out 0.15s both;
}

.subtitle {
    color: #475569;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.service-type {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.input-group input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    color: #1e293b;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-group .input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.input-group input:focus + .input-icon {
    opacity: 1;
}

.toggle-password {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.6;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.login-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.login-footer p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-header {
    background: var(--bg-white);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

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

.header-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.action-bar {
    padding: 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--bg-light);
}

.tab {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    transition: all 0.3s ease;
}

.tab:hover::before {
    background: rgba(255, 255, 255, 0.1);
}

.tab:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tab.active {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tab.active::before {
    background: rgba(255, 255, 255, 0.15);
}

.tab[data-status="RECEIVED"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab[data-status="SCORING"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tab[data-status="READY"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tab[data-view="upload-pg"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.tab[data-view="upload-psg"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tab-icon {
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
}

.tab-label {
    display: block;
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tab-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.tab.active .tab-count {
    background: rgba(255, 255, 255, 0.5);
}

.patient-list {
    padding: 20px;
}

.patient-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.patient-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.patient-info h3 {
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.patient-ref {
    color: var(--text-light);
    font-size: 0.85rem;
}

.study-type {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.study-type.PG {
    background: #dbeafe;
    color: #1e40af;
}

.study-type.PSG {
    background: #fef3c7;
    color: #92400e;
}

.patient-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.patient-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

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

#login-form .btn-primary {
    width: 100%;
    padding: 16px 20px;
    margin-top: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: fadeIn 0.6s ease-out 0.5s both;
}

#login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#login-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-block {
    width: 100%;
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.claim-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.claim-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-3px);
}

.claim-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.3rem;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.close:hover {
    color: var(--text-dark);
}

form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-input-wrapper {
    position: relative;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-name {
    display: block;
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: 6px;
    text-align: center;
    color: var(--text-light);
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.2s;
}

.file-name.selected {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.error {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

@media (min-width: 640px) {
    .tab-label {
        display: inline;
    }
    
    .tab-icon {
        display: none;
    }
}

@media (min-width: 768px) {
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .patient-card {
        padding: 20px;
    }
}

.time-tracking-panel {
    padding: 20px;
    background: var(--bg-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
}

.stat-card {
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.performance-card {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
}

.alert-card {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.stat-header {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: white;
    transition: width 0.5s ease;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* Upload Panel */
.upload-panel {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

.upload-header {
    text-align: center;
    margin-bottom: 32px;
}

.upload-header h2 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.upload-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

/* Dropzone */
.dropzone {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-white);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropzone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.dropzone.dragover {
    border-color: var(--primary);
    background: #dbeafe;
    transform: scale(1.02);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dropzone-icon {
    font-size: 64px;
}

.dropzone-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.dropzone-hint {
    font-size: 14px;
    color: var(--text-light);
}

/* Upload Queue */
.upload-queue {
    margin-top: 32px;
}

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

.queue-header h3 {
    font-size: 18px;
    color: var(--text-dark);
}

.queue-actions {
    display: flex;
    gap: 12px;
}

.queue-list {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-item-icon {
    font-size: 20px;
}

.queue-item-details {
    flex: 1;
}

.queue-item-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 4px;
}

.queue-item-meta {
    font-size: 12px;
    color: var(--text-light);
}

.queue-item-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

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

.status-uploading {
    color: var(--primary);
}

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

.status-error {
    color: var(--danger);
}

.queue-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 24px;
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    font-weight: 500;
    color: var(--text-dark);
}

.progress-stats {
    font-size: 14px;
    color: var(--text-light);
}

.progress-bar-container {
    background: var(--bg-light);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Upload Report */
.upload-report {
    margin-top: 24px;
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
}

.upload-report h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}

.report-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-section {
    padding: 12px;
    border-radius: 6px;
    background: var(--bg-light);
}

.report-section-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section-list {
    list-style: none;
    font-size: 14px;
    color: var(--text-light);
}

.report-section-list li {
    padding: 4px 0;
}

.report-success {
    border-left: 4px solid var(--success);
}

.report-error {
    border-left: 4px solid var(--danger);
}

/* Admin View */
.admin-header {
    padding: 32px 24px 16px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-white);
}

.admin-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.admin-header p {
    color: var(--text-light);
    font-size: 14px;
}

.users-table-container {
    padding: 24px;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.users-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.users-table tbody tr:hover {
    background: var(--bg-light);
}

.users-table td {
    padding: 16px;
    color: var(--text-dark);
}

.user-email {
    font-weight: 500;
    color: var(--primary);
}

.user-role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role-badge.admin {
    background: #fef3c7;
    color: #92400e;
}

.user-role-badge.physician {
    background: #dbeafe;
    color: #1e40af;
}

.user-role-badge.technician {
    background: #dcfce7;
    color: #166534;
}

.user-role-badge.viewer {
    background: #f3f4f6;
    color: #374151;
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.user-status.active {
    background: #dcfce7;
    color: #166534;
}

.user-status.suspended {
    background: #fee2e2;
    color: #991b1b;
}

.user-stats {
    font-size: 13px;
    color: var(--text-light);
}

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

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-suspend {
    background: #fef3c7;
    color: #92400e;
}

.action-btn-suspend:hover {
    background: #fde68a;
}

.action-btn-activate {
    background: #dcfce7;
    color: #166534;
}

.action-btn-activate:hover {
    background: #bbf7d0;
}

.action-btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn-delete:hover {
    background: #fecaca;
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.legal-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 6px 20px;
    text-align: center;
    font-size: 11px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 1px solid #475569;
}

.legal-notice p {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

body {
    padding-top: 30px;
}

#login-screen {
    padding-top: 50px;
}

.otp-email {
    text-align: center;
    font-size: 1.1rem;
    color: #764ba2;
    font-weight: 600;
    margin: 0.5rem 0 2rem 0;
}

.checkbox-group {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e293b;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #764ba2;
}

.checkbox-label span {
    flex: 1;
}

#otp-cancel-btn {
    margin-top: 1rem;
    width: 100%;
}

#otp-screen {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 1000;
}

#otp-screen.active {
    display: flex;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

#create-user-form {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

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

.role-description {
    color: #764ba2;
    font-weight: 500;
}

.permissions-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.permissions-section h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.permissions-grid {
    display: grid;
    gap: 10px;
}

.permission-item {
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-actions button {
    flex: 1;
}

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

.admin-header-content > div {
    flex: 1;
}

#add-user-btn {
    white-space: nowrap;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px 16px 12px 16px;
    }
    
    #create-user-form {
        padding: 20px 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .admin-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    #add-user-btn {
        width: 100%;
    }
}

/* Invoice Modal */
.modal-large .modal-content {
    max-width: 800px;
}

.alert-message {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
    color: #92400e;
}

/* Invoice Cards */
.invoice-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.invoice-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.invoice-period {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.invoice-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-unpaid {
    background: #fef3c7;
    color: #92400e;
}

.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.invoice-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.invoice-detail {
    text-align: center;
}

.invoice-detail-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.invoice-detail-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.invoice-total {
    text-align: right;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.invoice-total-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.invoice-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.invoice-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-pay {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-view {
    background: white;
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.invoices-panel {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.invoices-header {
    margin-bottom: 24px;
}

.invoices-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.invoices-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.invoices-list {
    display: grid;
    gap: 16px;
}

.invoice-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.invoice-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.invoice-card-title {
    flex: 1;
}

.invoice-card-title h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.invoice-card-title p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.invoice-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.PAID {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.UNPAID {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.OVERDUE {
    background: #fef3c7;
    color: #92400e;
}

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

.invoice-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invoice-stat-label {
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.invoice-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download-pdf:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-download-pdf:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .invoice-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .invoice-actions {
        flex-direction: column;
    }
    
    .btn-pay, .btn-view {
        width: 100%;
    }
    
    .invoice-card-body {
        grid-template-columns: 1fr;
    }
    
    .invoice-card-footer {
        flex-direction: column;
    }
    
    .btn-download-pdf {
        width: 100%;
        justify-content: center;
    }
}
