/* =====================================================
   Claims Management System - Dashboard Styles
   Supabase-inspired sidebar navigation
   ===================================================== */

:root {
    /* Sidebar Colors */
    --sidebar-width: 250px;
    --sidebar-bg: #1a1f2e;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #a3a8b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-text-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(74, 108, 247, 0.15);
    --sidebar-active-border: #4a6cf7;

    /* Primary Colors */
    --primary: #4a6cf7;
    --primary-dark: #3a5bd9;
    --primary-light: rgba(74, 108, 247, 0.1);

    /* Content Colors */
    --content-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1a1f2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;

    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   Base Layout
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.dashboard-body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--content-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   Sidebar
   ===================================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Sidebar Header */
.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 65px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-logo img {
    height: 32px;
    background: white;
    padding: 5px 12px;
    border-radius: 6px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: var(--sidebar-text-hover);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Navigation Items */
.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sidebar-text);
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    margin-left: -3px;
    padding-left: 23px;
}

.nav-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-active-border);
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-badge.soon {
    background: var(--primary-light);
    color: var(--primary);
}

/* Dropdown */
.nav-dropdown {
    display: flex;
    flex-direction: column;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    margin-left: -3px;
    padding-left: 23px;
}

.nav-dropdown-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

.nav-dropdown.active > .nav-dropdown-toggle {
    color: var(--sidebar-text-active);
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-dropdown.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
}

.nav-dropdown.expanded .nav-dropdown-content {
    display: flex;
}

.nav-dropdown-content .nav-item {
    padding-left: 56px;
    font-size: 13px;
}

/* Spacer */
.nav-spacer {
    flex: 1;
    min-height: 20px;
}

/* Sidebar User */
.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    color: var(--sidebar-text-active);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    display: block;
    color: var(--sidebar-text);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 18px;
}

.btn-logout:hover {
    background: var(--sidebar-hover-bg);
    color: var(--error);
}

/* =====================================================
   Main Content Area
   ===================================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    padding: 12px 16px;
    background: var(--sidebar-bg);
    color: white;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.mobile-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Content Container */
.content-container {
    padding: 24px;
    flex: 1;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: all 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   Content Components
   ===================================================== */

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); }
.stat-icon.green { background: rgba(34, 197, 94, 0.1); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.1); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label.required::after {
    content: ' *';
    color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--content-bg);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.btn-disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    color: #888 !important;
    cursor: not-allowed;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: #fafbfc;
}

.data-table tbody tr:hover {
    background: var(--content-bg);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-new {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-in_progress {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-resolved {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-closed {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Priority Badges */
.priority-low { color: #64748b; }
.priority-medium { color: #f59e0b; }
.priority-high { color: #f97316; }
.priority-critical { color: #ef4444; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Messages */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #166534;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-card {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.action-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* =====================================================
   Responsive Styles
   ===================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .content-container {
        padding: 20px 16px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .content-container {
        padding: 16px 12px;
    }

    .page-title {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 16px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-card {
        min-width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mobile-header {
        padding: 10px 12px;
    }

    .content-container {
        padding: 12px 10px;
    }

    .card-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn {
        width: 100%;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .nav-dropdown-toggle,
    .btn,
    .action-card {
        min-height: 44px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
        font-size: 16px;
    }
}

/* =====================================================
   Entity Type Toggle (Profile Form)
   ===================================================== */

.entity-type-toggle {
    display: flex;
    gap: 12px;
}

.entity-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entity-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.entity-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.entity-btn .entity-icon {
    font-size: 18px;
}

@media (max-width: 480px) {
    .entity-type-toggle {
        flex-direction: column;
        gap: 8px;
    }

    .entity-btn {
        padding: 12px 14px;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* =====================================================
   File Upload Component
   ===================================================== */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(74, 108, 247, 0.04);
}

.upload-area.drag-over {
    border-color: var(--primary);
    border-style: solid;
    background: rgba(74, 108, 247, 0.08);
    transform: scale(1.01);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-icon svg {
    width: 48px;
    height: 48px;
}

.upload-area:hover .upload-icon,
.upload-area.drag-over .upload-icon {
    color: var(--primary);
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f5f7fa;
    border-radius: 8px;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

.file-icon {
    flex-shrink: 0;
}

.file-icon span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.icon-pdf { background: #e74c3c; }
.icon-image { background: #9b59b6; }
.icon-doc { background: #3498db; }
.icon-xls { background: #27ae60; }
.icon-ppt { background: #e67e22; }
.icon-file { background: #95a5a6; }

.file-info {
    flex: 1;
    min-width: 150px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    word-break: break-word;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-queued,
.status-uploading {
    background: #fff3e0;
    color: #e65100;
}

.status-processing,
.status-docling,
.status-ai_analysis {
    background: #e3f2fd;
    color: #1565c0;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
}

.file-progress {
    width: 100px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    display: none;
    flex-shrink: 0;
}

.file-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 20px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.ai-summary-preview {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(74, 108, 247, 0.08);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

.ai-summary-preview.error {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: var(--error);
}

.ai-summary-preview strong {
    color: var(--text-primary);
}

/* AI Preview Section */
.ai-preview {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(74, 108, 247, 0.2);
}

.ai-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ai-preview-icon {
    font-size: 24px;
}

.ai-preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ai-data {
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-file-analysis {
    padding: 12px 0;
}

.ai-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-data p {
    margin: 6px 0;
    line-height: 1.5;
}

.ai-data ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-data li {
    margin: 4px 0;
}

.ai-divider {
    border: none;
    border-top: 1px solid rgba(74, 108, 247, 0.15);
    margin: 12px 0;
}

/* Preliminary AI Claim Analysis Field */
.ai-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.ai-analysis-header .form-label {
    margin-bottom: 0;
}

.ai-label-icon {
    margin-right: 8px;
    font-size: 18px;
}

.btn-ai-analyze {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
    background: linear-gradient(135deg, #4a6cf7 0%, #6366f1 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(74, 108, 247, 0.35);
    transition: all 0.3s ease;
}

.btn-ai-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 108, 247, 0.45);
}

.btn-ai-analyze:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-ai-analyze .btn-ai-icon {
    font-size: 16px;
}

.btn-ai-analyze.analyzing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-ai-analyze.analyzing .btn-ai-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.ai-analysis-container {
    position: relative;
}

.ai-analysis-textarea {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid rgba(74, 108, 247, 0.3);
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
    resize: none;
    color: var(--text-primary);
}

.ai-analysis-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.ai-analysis-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.ai-analysis-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.ai-analysis-meta .ai-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-analysis-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    color: #f57c00;
    font-size: 13px;
}

.ai-analysis-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffe082;
    border-top-color: #f57c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Upload Notifications */
#uploadNotifications {
    margin-top: 8px;
}

.upload-notification {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

.upload-notification.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.upload-notification.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.upload-notification.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for file upload */
@media (max-width: 768px) {
    .upload-area {
        padding: 30px 16px;
    }

    .upload-icon svg {
        width: 40px;
        height: 40px;
    }

    .upload-text {
        font-size: 15px;
    }

    .file-item {
        padding: 10px 12px;
    }

    .file-icon span {
        width: 36px;
        height: 36px;
        font-size: 10px;
    }

    .file-info {
        min-width: 120px;
    }

    .file-name {
        font-size: 13px;
    }

    .status-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .file-progress {
        width: 80px;
    }

    .ai-preview {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .file-status {
        align-self: flex-start;
    }

    .file-remove {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .file-progress {
        width: 100%;
    }
}

/* =====================================================
   AI Badge and Analysis Modal
   ===================================================== */

/* AI badge in claims list */
.ai-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    cursor: help;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Analysis Modal specifics */
.ai-analysis-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ai-modal-info {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-modal-analysis {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid rgba(74, 108, 247, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.ai-modal-analysis pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    /* AI Analysis header responsive */
    .ai-analysis-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-ai-analyze {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
}

/* =====================================================
   Subscription & Payment Styles
   ===================================================== */

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.plan-card {
    background: var(--card-bg, #fff);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: var(--primary, #4a6cf7);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.15);
    transform: translateY(-2px);
}

.plan-card.current {
    border-color: var(--success, #22c55e);
    background: rgba(34, 197, 94, 0.05);
}

.plan-card.recommended {
    border-color: var(--primary, #4a6cf7);
}

.plan-badge-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary, #4a6cf7), #7c3aed);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.plan-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary, #1e293b);
}

.plan-description {
    color: var(--text-secondary, #64748b);
    font-size: 14px;
    margin-bottom: 20px;
    min-height: 40px;
}

.plan-price {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
}

.price-period {
    font-size: 16px;
    color: var(--text-secondary, #64748b);
}

.price-free {
    font-size: 28px;
    font-weight: 700;
    color: var(--success, #22c55e);
}

.price-custom {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary, #4a6cf7);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex-grow: 1;
}

.plan-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: "✓";
    color: var(--success, #22c55e);
    font-weight: bold;
    flex-shrink: 0;
}

.plan-card .btn-block {
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary, #f1f5f9);
    padding: 4px;
    border-radius: 8px;
}

.btn-toggle {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary, #64748b);
}

.btn-toggle:hover {
    color: var(--text-primary, #1e293b);
}

.btn-toggle.active {
    background: var(--primary, #4a6cf7);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3);
}

.discount-badge {
    background: var(--success, #22c55e);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

/* Subscription Status */
.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.plan-badge {
    padding: 8px 20px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.free {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

.plan-badge.professional {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: white;
}

.plan-badge.enterprise {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

/* New plan badge types matching tariffs.html */
.plan-badge.basic {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

.plan-badge.extended {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: white;
}

.plan-badge.individual {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

.status-active {
    color: var(--success, #22c55e);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-active::before {
    content: "●";
    font-size: 10px;
}

.status-expired {
    color: var(--error, #ef4444);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-expired::before {
    content: "●";
    font-size: 10px;
}

.subscription-details {
    color: var(--text-secondary, #64748b);
    font-size: 14px;
}

.subscription-details p {
    margin: 6px 0;
}

.subscription-details strong {
    color: var(--text-primary, #1e293b);
}

/* Limit Warning Modal */
.limit-warning {
    text-align: center;
    padding: 24px 16px;
}

.limit-icon {
    font-size: 56px;
    margin-bottom: 20px;
    line-height: 1;
}

.limit-warning p {
    margin-bottom: 14px;
    color: var(--text-secondary, #64748b);
    font-size: 15px;
    line-height: 1.6;
}

.limit-warning strong {
    color: var(--primary, #4a6cf7);
}

/* Payment Status Badges */
.status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-succeeded {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-refunded {
    background: #f3e8ff;
    color: #7c3aed;
}

.status-badge.status-canceled {
    background: #e2e8f0;
    color: #475569;
}

/* Margin utilities */
.mb-2 {
    margin-bottom: 24px;
}

.mt-1 {
    margin-top: 12px;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Loading spinner for plans */
.plans-grid .loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 40px;
}

/* Responsive adjustments for subscription page */
@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plan-card {
        padding: 20px;
    }

    .plan-badge-popular {
        font-size: 11px;
        padding: 4px 14px;
    }

    .price-amount {
        font-size: 28px;
    }

    .billing-toggle {
        flex-direction: column;
        width: 100%;
    }

    .btn-toggle {
        width: 100%;
        text-align: center;
    }

    .subscription-plan {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-header.flex-between {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
}

/* =====================================================
   Support Ticket Styles
   ===================================================== */

/* Ticket Stats Grid */
.ticket-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ticket-stat {
    text-align: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.ticket-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.ticket-stat-value.open {
    color: #2196f3;
}

.ticket-stat-value.progress {
    color: #ff9800;
}

.ticket-stat-value.resolved {
    color: #4caf50;
}

.ticket-stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Support Contact Info */
.support-contact-info {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.support-contact-info h4 {
    margin: 0 0 12px;
    color: #333;
    font-size: 14px;
}

.support-contact-info p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #555;
}

.support-contact-info p:last-child {
    margin-bottom: 0;
}

.support-contact-info a {
    color: #667eea;
    text-decoration: none;
}

.support-contact-info a:hover {
    text-decoration: underline;
}

/* Ticket Status Badges */
.ticket-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.ticket-status-badge.status-open {
    background: #e3f2fd;
    color: #1976d2;
}

.ticket-status-badge.status-in_progress {
    background: #fff3e0;
    color: #f57c00;
}

.ticket-status-badge.status-waiting {
    background: #fce4ec;
    color: #c2185b;
}

.ticket-status-badge.status-resolved {
    background: #e8f5e9;
    color: #388e3c;
}

.ticket-status-badge.status-closed {
    background: #f5f5f5;
    color: #757575;
}

/* Ticket View Modal */
.ticket-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ticket-badge.status-open {
    background: #e3f2fd;
    color: #1976d2;
}

.ticket-badge.status-in_progress {
    background: #fff3e0;
    color: #f57c00;
}

.ticket-badge.status-waiting {
    background: #fce4ec;
    color: #c2185b;
}

.ticket-badge.status-resolved {
    background: #e8f5e9;
    color: #388e3c;
}

.ticket-badge.status-closed {
    background: #f5f5f5;
    color: #757575;
}

.ticket-badge.priority-low {
    background: #f5f5f5;
    color: #757575;
}

.ticket-badge.priority-normal {
    background: #e8f5e9;
    color: #388e3c;
}

.ticket-badge.priority-high {
    background: #fff3e0;
    color: #f57c00;
}

.ticket-badge.priority-urgent {
    background: #ffebee;
    color: #d32f2f;
}

.ticket-badge.category {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ticket-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #888;
    text-align: right;
}

.ticket-subject {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.ticket-message {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

/* Ticket Replies */
.ticket-replies h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
}

.ticket-reply {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.ticket-reply.user {
    background: #e3f2fd;
    margin-left: 20px;
}

.ticket-reply.staff {
    background: #f3e5f5;
    margin-right: 20px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reply-author {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.reply-date {
    font-size: 11px;
    color: #888;
}

.reply-message {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Ticket Reply Form */
.ticket-reply-form {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.ticket-reply-form h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #333;
}

/* Responsive Ticket Styles */
@media (max-width: 768px) {
    .ticket-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ticket-stat-value {
        font-size: 22px;
    }

    .ticket-view-header {
        flex-direction: column;
        gap: 12px;
    }

    .ticket-dates {
        text-align: left;
    }

    .ticket-reply.user {
        margin-left: 10px;
    }

    .ticket-reply.staff {
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .ticket-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ticket-stat {
        padding: 12px 8px;
    }

    .ticket-stat-value {
        font-size: 20px;
    }

    .ticket-meta {
        flex-direction: column;
    }
}

/* Support Contact Info */
.support-contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.contact-icon {
    font-size: 24px;
    line-height: 1;
}

.contact-item strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.contact-item p {
    margin: 0;
    color: #666;
}

.contact-item a {
    color: #667eea;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Support Success Message */
.support-success-message {
    text-align: center;
    padding: 40px 20px;
}

.support-success-message .success-icon {
    width: 64px;
    height: 64px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}

.support-success-message h3 {
    color: #333;
    margin: 0 0 10px;
    font-size: 20px;
}

.support-success-message p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* =====================================================
   Input with Button (for Реквизиты, INN lookup, etc.)
   ===================================================== */
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.input-with-button .form-input {
    flex: 1;
}

.input-with-button .btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    height: 44px;
}

/* =====================================================
   Form Validation Styles
   ===================================================== */
.form-input.valid {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.05);
}

.form-input.invalid {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.form-error.hidden {
    display: none;
}

/* =====================================================
   Large Modal for Company Details
   ===================================================== */
.modal-lg {
    max-width: 700px;
    width: 95%;
}

.modal-lg .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Loading state for INN/BIK lookup */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Country select optgroup styling */
select.form-input optgroup {
    font-weight: 600;
    color: #475569;
}

select.form-input option {
    font-weight: normal;
    padding: 8px;
}

/* Phone validation hint */
#phoneHint {
    transition: color 0.2s;
}

#phoneHint.valid {
    color: #22c55e;
}

#phoneHint.invalid {
    color: #ef4444;
}

/* =====================================================
   Payment Method Selection
   ===================================================== */

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.payment-method-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-method-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.payment-method-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.payment-method-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.payment-method-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

@media (max-width: 480px) {
    .payment-methods-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Invoice Styles
   ===================================================== */

.invoice-container {
    background: white;
    padding: 40px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
}

.invoice-header h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.invoice-header .invoice-number {
    font-size: 18px;
    color: #333;
}

.invoice-section {
    margin-bottom: 24px;
}

.invoice-section h3 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: #333;
}

.invoice-details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 12px;
}

.invoice-details dt {
    font-weight: normal;
    color: #666;
}

.invoice-details dd {
    font-weight: 500;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.invoice-table th,
.invoice-table td {
    border: 1px solid #000;
    padding: 10px 12px;
    text-align: left;
}

.invoice-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.invoice-table .text-right {
    text-align: right;
}

.invoice-total {
    margin-top: 20px;
    text-align: right;
}

.invoice-total .total-row {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 8px;
}

.invoice-total .total-label {
    font-weight: normal;
}

.invoice-total .total-value {
    font-weight: bold;
    min-width: 150px;
    text-align: right;
}

.invoice-total .grand-total {
    font-size: 18px;
    border-top: 2px solid #000;
    padding-top: 12px;
    margin-top: 12px;
}

.invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

.invoice-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
}

.signature-block {
    text-align: center;
}

.signature-line {
    border-bottom: 1px solid #000;
    height: 40px;
    margin-bottom: 8px;
}

.signature-label {
    font-size: 12px;
    color: #666;
}

/* Modal XL for invoice */
.modal-xl {
    max-width: 900px;
    width: 95%;
}

@media print {
    .invoice-container {
        padding: 20px;
    }
}
