/* style.css content here */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page {
    min-height: 100vh;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-icon {
    background: #4f46e5;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-input {
    position: relative;
}

.password-input button {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
}

.password-input button:hover {
    color: #374151;
}

.error-message {
    background: #fee;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.login-btn {
    width: 100%;
    background: #4f46e5;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #4338ca;
}

.quick-login {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.quick-login p {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 500;
}

.quick-login-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-btn {
    padding: 0.625rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn {
    background: #e0e7ff;
    color: #4f46e5;
}

.admin-btn:hover {
    background: #c7d2fe;
}

.receptionist-btn {
    background: #dcfce7;
    color: #16a34a;
}

.receptionist-btn:hover {
    background: #bbf7d0;
}

.initiator-btn {
    background: #fed7aa;
    color: #ea580c;
}

.initiator-btn:hover {
    background: #fdba74;
}

.signatory-btn {
    background: #fecaca;
    color: #dc2626;
}

.signatory-btn:hover {
    background: #fca5a5;
}

.accountant-btn {
    background: #e9d5ff;
    color: #9333ea;
    grid-column: 1 / -1;
}

.accountant-btn:hover {
    background: #d8b4fe;
}

.demo-accounts {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.demo-accounts p {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.demo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.demo-item span:first-child {
    font-weight: 500;
}

.demo-item span:last-child {
    font-family: monospace;
}

/* Main App Styles */
.app-header {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.user-avatar.green {
    background: #16a34a;
}

.user-avatar.orange {
    background: #ea580c;
}

.user-avatar.red {
    background: #dc2626;
}

.user-avatar.purple {
    background: #9333ea;
}

.user-avatar.indigo {
    background: #4f46e5;
}

.user-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.user-info p {
    font-size: 0.875rem;
    color: #6b7280;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.device-toggle select {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.notification-wrapper {
    position: relative;
}

.notification-btn {
    position: relative;
    padding: 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-btn:hover {
    background: #f9fafb;
}

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #e5e7eb;
}

.notification-panel {
    position: fixed;
    top: 4rem;
    right: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    max-width: 24rem;
    max-height: 24rem;
    overflow-y: auto;
    z-index: 50;
}

.notification-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.notification-item {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

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

.notification-item.error {
    background: #fee;
    color: #dc2626;
}

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

.notification-item p {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.notification-item small {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.tab-btn:hover {
    color: #374151;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Buttons */
.btn-primary {
    background: #4f46e5;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #16a34a;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-large {
    padding: 1rem;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
}

/* Tables */
.users-table, .invoices-table {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.users-table table, .invoices-table table {
    width: 100%;
}

.users-table th, .invoices-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-table td, .invoices-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Badges */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-badge.green {
    background: #dcfce7;
    color: #16a34a;
}

.role-badge.orange {
    background: #fed7aa;
    color: #ea580c;
}

.role-badge.red {
    background: #fecaca;
    color: #dc2626;
}

.role-badge.purple {
    background: #e9d5ff;
    color: #9333ea;
}

.role-badge.indigo {
    background: #e0e7ff;
    color: #4f46e5;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.inactive {
    background: #fee;
    color: #dc2626;
}

.status-badge.registered {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.confirmed {
    background: #fed7aa;
    color: #ea580c;
}

.status-badge.approved {
    background: #fecaca;
    color: #dc2626;
}

.status-badge.accounted {
    background: #e9d5ff;
    color: #9333ea;
}

.status-badge.archived {
    background: #dcfce7;
    color: #16a34a;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn.edit:hover {
    background: #bfdbfe;
}

.action-btn.toggle {
    background: #fed7aa;
    color: #ea580c;
}

.action-btn.toggle:hover {
    background: #fdba74;
}

.action-btn.delete {
    background: #fee;
    color: #dc2626;
}

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

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #16a34a;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    background: #f0fdf4;
    margin-bottom: 2rem;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: #15803d;
}

.upload-label {
    cursor: pointer;
    display: block;
}

.upload-label svg {
    color: #16a34a;
    margin-bottom: 1rem;
}

.upload-label p {
    color: #16a34a;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-label .text-sm {
    color: #6b7280;
    font-weight: 400;
}

/* AI Extraction */
.ai-extraction {
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ai-extraction h3 {
    color: #0ea5e9;
    font-weight: 600;
    margin-bottom: 1rem;
}

.extraction-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.extraction-field {
    display: flex;
    flex-direction: column;
}

.extraction-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.ai-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    font-size: 0.875rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Invoice Cards */
.invoice