* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: radial-gradient(circle at center, #1e3a8a 0%, #000000 100%);
    min-height: 100vh;
    font-size: 80%; /* Reduced global font size by 20% */
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #1e3a8a 0%, #000000 100%);
}

.login-container {
    max-width: 400px;
    width: 90%;
    background: #111111;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header .logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-header .logo-section i {
    font-size: 2rem;
}

.login-header .logo-section h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.login-form {
    padding: 2rem;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.flash-message.success {
    background: rgba(30, 58, 138, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(30, 58, 138, 0.3);
}

.flash-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-message.info {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.flash-message.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #ffffff;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f9fafb;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-form .form-group input {
    width: 100%;
    padding: 0.75rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #f9fafb;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.login-actions {
    margin-top: 2rem;
}

.login-actions .btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #1e3a8a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-actions .btn-primary:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.login-footer {
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid #374151;
    background: #0a0a0a;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-footer i {
    color: #1e3a8a;
}

/* Chat-specific body styles */
body.chat-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.chat-page .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox with overflow */
}
/* Usage page main content background */
body.usage-page .main-content {
    background: radial-gradient(circle at center, #1e3a8a 0%, #000000 100%);
}

/* Chat page main content background */
body.chat-page .main-content {
    background: radial-gradient(circle at center, #1e3a8a 0%, #000000 100%);
}

body.chat-page .chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0; /* Important for flexbox with overflow */
}

/* Chat messages should be scrollable */
body.chat-page .chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Important for flexbox with overflow */
}

/* Setup Page Styles */
.setup-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

.setup-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(30, 58, 138, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.setup-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(17, 17, 17, 0.95);
    border: 2px solid #1e3a8a;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(10px);
}

.setup-header {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(30, 64, 175, 0.9));
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.3);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setup-logo {
    height: 40px;
    width: auto;
    filter: brightness(1.2);
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.setup-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.setup-form {
    flex: 1;
    padding: 2.5rem;
    background: rgba(0, 0, 0, 0.3);
}

.setup-step {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.setup-step h2 {
    color: #dc2626;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.setup-step h2 i {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.setup-step p {
    color: #9ca3af;
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.form-group {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.form-group label {
    display: block;
    color: #f9fafb;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
    background: rgba(31, 41, 55, 0.95);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    line-height: 1.6;
}

.char-count {
    text-align: right;
    margin-top: 0.5rem;
}

.char-count span {
    font-size: 0.9rem;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.setup-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
    padding: 2rem 0;
}

.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.3);
    color: #9ca3af;
    border: 2px solid #374151;
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(31, 41, 55, 0.8);
    color: #f9fafb;
    border-color: #6b7280;
    transform: translateY(-2px);
}

.setup-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(55, 65, 81, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.setup-footer p {
    color: #6b7280;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
    font-weight: 500;
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #000000;
    border-top: 1px solid #1e3a8a;
}

.footer-logo-img {
    height: 60px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-logo-img:hover {
    opacity: 1;
}

/* Chat Footer Styles */
.chat-footer {
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid #374151;
    background: #111111;
    margin-top: auto; /* Push to bottom */
}

.chat-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
}

.chat-container {
    max-width: 2080px;
    margin: 0 10%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111111;
    border: 2px solid #1e3a8a;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.3);
}

.chat-header {
    background: #000000;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.3);
    position: relative;
    border-bottom: 2px solid #1e3a8a;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo-img {
    height: 40px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.header-logo-img:hover {
    opacity: 1;
}

.header-content i {
    font-size: 1.5rem;
}

.header-content h1 {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.document-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #1e3a8a;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.document-count.hidden {
    display: none;
}

/* Document Panel */
.document-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: #1a1a1a;
    border-left: 2px solid #1e3a8a;
    box-shadow: -5px 0 15px rgba(30, 58, 138, 0.3);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.document-panel.open {
    right: 0;
}

.document-panel-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.document-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-panel-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.document-upload-area {
    padding: 1rem;
    border-bottom: 1px solid #4a4a4a;
    background: #1a1a1a;
}

.upload-zone {
    border: 2px dashed #6b7280;
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #2a2a2a;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #1e3a8a;
    background: #3a3a3a;
}

.upload-zone i {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    margin: 0.5rem 0;
    color: #d1d5db;
}

.upload-hint {
    font-size: 0.8rem !important;
    color: #9ca3af !important;
}

#fileInput {
    display: none;
}

.document-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a1a;
}

.document-list-header {
    padding: 1rem;
    border-bottom: 1px solid #4a4a4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
}

.document-list-header h4 {
    margin: 0;
    color: #d1d5db;
}

.document-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background: #1e3a8a;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.875rem;
    color: #9ca3af;
}

.documents {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    background: #1a1a1a;
}

.no-documents {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.no-documents i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.document-item {
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.document-item:hover {
    background: #3a3a3a;
    border-color: #6b7280;
}

.document-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 500;
    color: #d1d5db;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.document-actions {
    display: flex;
    gap: 0.25rem;
}

.doc-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background 0.3s ease;
    color: #9ca3af;
}

.doc-btn:hover {
    background: #4a4a4a;
    color: #d1d5db;
}

.doc-btn.delete:hover {
    background: #1e3a8a;
    color: #ffffff;
}

.doc-status {
    color: #9ca3af;
    font-size: 0.875rem;
}

.doc-status.active {
    color: #1e3a8a;
    font-weight: 500;
}

.context-status {
    color: #9ca3af;
    font-size: 0.875rem;
}

.context-status.active {
    color: #1e3a8a;
    font-weight: 500;
}

/* Document Panel Overlay */
.document-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.document-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Context Panel */
.context-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: #1a1a1a;
    border-right: 2px solid #1e3a8a;
    box-shadow: 5px 0 15px rgba(30, 58, 138, 0.3);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.context-panel.open {
    left: 0;
}

.context-panel-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.context-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.context-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #1a1a1a;
}

.context-description {
    margin-bottom: 1rem;
}

.context-description p {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.context-controls {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #4a4a4a;
}

.context-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.context-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.context-label {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
}

#contextInput,
#systemInput {
    background: #2a2a2a;
    border: 2px solid #4a4a4a;
    border-radius: 0.5rem;
    padding: 1rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    transition: border-color 0.3s ease;
}

#contextInput:focus,
#systemInput:focus {
    outline: none;
    border-color: #1e3a8a;
}

#contextInput::placeholder,
#systemInput::placeholder {
    color: #6b7280;
}

.context-field-info {
    display: flex;
    justify-content: flex-end;
}

#contextCharCount,
#systemCharCount {
    color: #9ca3af;
    font-size: 0.75rem;
}

.context-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.save-context-btn {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.save-context-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.save-context-btn:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Main content adjustment when panel is open */
.main-content {
    transition: padding-right 0.3s ease;
}

.main-content.panel-open {
    padding-right: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .document-panel {
        width: 100%;
        right: -100%;
    }
    
    .main-content.panel-open {
        padding-right: 0;
    }
    
    .header-buttons {
        gap: 0.25rem;
    }
    
    .header-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .document-count {
        font-size: 0.7rem;
        min-width: 16px;
        height: 16px;
        line-height: 1;
    }
}

/* File upload progress indicator */
.upload-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: center;
    display: none;
}

.upload-progress.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    background: radial-gradient(circle at center, #1e3a8a 0%, #2d2d2d 100%);
    scroll-behavior: smooth;
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    order: 2;
    margin-right: 0;
    margin-left: 1rem;
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.user-message .message-content {
    order: 1;
    text-align: right;
}

.message-text {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.user-message .message-text {
    background: #020011;
    color: white;
    border-bottom-right-radius: 0.25rem;
    border: 1px solid #404040;
}

.assistant-message .message-text {
    background: #fffacd;
    color: #000000;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #f0e68c;
}

.message-time {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-message .message-time {
    color: #64748b;
}

.message-usage {
    font-size: 0.75rem;
    color: #3b82f6;
    font-weight: 500;
    opacity: 0.9;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    background: #1a1a1a;
    border-top: 1px solid #1e3a8a;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    background: #2a2a2a;
    border: 2px solid #1e3a8a;
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: #ffffff;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}

#messageInput::placeholder {
    color: #94a3b8;
}

.send-btn {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:enabled:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.send-btn:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    transform: none;
}

.input-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.divider {
    color: #6b7280;
}

.loading-indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(79, 70, 229, 0.1);
    border-top: 1px solid rgba(79, 70, 229, 0.2);
    color: #4f46e5;
    font-weight: 500;
}

.loading-indicator.show {
    display: flex;
}

.typing-animation {
    display: flex;
    gap: 3px;
}

.typing-animation span {
    width: 6px;
    height: 6px;
    background: #4f46e5;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.toast.show {
    display: flex;
}

.error-toast {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.success-toast {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
        margin: 0;
        max-width: 100%;
        border-left: none;
        border-right: none;
    }
    
    .chat-header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .header-logo-img {
        height: 32px;
    }
    
    .header-content h1 {
        font-size: 1rem;
    }
    
    .header-buttons {
        gap: 0.25rem;
    }
    
    .header-btn {
        width: 36px;
        height: 36px;
        padding: 0.375rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .message-text {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .message-text pre {
        font-size: 0.8rem;
        padding: 0.75rem;
        overflow-x: scroll;
    }
    
    .message-actions {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .chat-input-container {
        padding: 0.75rem;
    }
    
    .input-wrapper {
        min-height: 45px;
    }
    
    #chat-input {
        font-size: 0.9rem;
        padding: 0.75rem 3rem 0.75rem 1rem;
        max-height: 120px;
    }
    
    #send-btn {
        width: 36px;
        height: 36px;
        right: 0.5rem;
    }
    
    #send-btn i {
        font-size: 1rem;
    }
    
    /* Document panel mobile adjustments */
    .document-panel {
        width: 100%;
        right: -100%;
    }
    
    .document-panel.open {
        right: 0;
    }
    
    .document-panel-header {
        padding: 0.75rem 1rem;
    }
    
    .document-item {
        padding: 0.75rem;
    }
    
    .document-info h3 {
        font-size: 0.9rem;
    }
    
    .document-info p {
        font-size: 0.8rem;
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        font-size: 0.9rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .header-content h1 {
        font-size: 0.9rem;
    }
    
    .header-btn {
        width: 32px;
        height: 32px;
    }
    
    .message-text {
        font-size: 0.85rem;
        padding: 0.625rem;
    }
    
    .chat-input-container {
        padding: 0.5rem;
    }
    
    #chat-input {
        font-size: 0.85rem;
        padding: 0.625rem 2.5rem 0.625rem 0.75rem;
    }
    
    #send-btn {
        width: 32px;
        height: 32px;
    }
}

/* Code block styling */
.message-text pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.message-text code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

/* Responsive styles for setup page */
@media (max-width: 768px) {
    .setup-container {
        margin: 0;
        border: none;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .setup-header {
        padding: 1.5rem 1rem;
    }
    
    .logo-section h1 {
        font-size: 1.5rem;
    }
    
    .setup-form {
        padding: 1.5rem 1rem;
    }
    
    .setup-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .setup-footer {
        padding: 1rem;
    }
    
    .footer-logo {
        padding: 1rem;
    }
    
    .footer-logo-img {
        height: 50px;
    }
}

@media (max-height: 600px) {
    .setup-header {
        padding: 1rem;
    }
    
    .setup-form {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group textarea {
        min-height: 80px;
    }
}

.user-message .message-text code {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Header Navigation */
.header {
    background: #000000;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #1e3a8a;
    position: relative;
}

.header-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.mobile-menu-toggle {
    display: none;
    background: rgba(30, 58, 138, 0.5);
    border: 1px solid #3b82f6;
    color: white;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(30, 58, 138, 0.8);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 500;
    background: rgba(30, 58, 138, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin-left: auto;
    margin-right: 20px;
}

.header-user i {
    color: #3b82f6;
    font-size: 0.9rem;
}

.username {
    font-size: 0.9rem;
    color: #e2e8f0;
}

.token-usage {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(59, 130, 246, 0.5);
    font-size: 0.8rem;
    color: #fbbf24;
    white-space: nowrap;
}

.token-usage i {
    color: #fbbf24;
    font-size: 0.8rem;
}

.session-timeout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid rgba(59, 130, 246, 0.5);
    font-size: 0.85rem;
    color: #4CAF50;
    white-space: nowrap;
    font-weight: 600;
    transition: color 0.3s ease;
}

.session-timeout i {
    font-size: 0.85rem;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.usage-separator {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 0 0 auto;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.nav-link.active {
    background: #1e3a8a;
    color: #ffffff;
}

/* Mobile Navigation Menu */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }
    
    .header-logo {
        order: 1;
        flex: 1;
    }
    
    .header-logo img {
        height: 32px;
    }
    
    .header-user {
        order: 3;
        width: 100%;
        margin: 10px 0 0 0;
        padding: 8px 12px;
        font-size: 0.85rem;
        justify-content: center;
    }
    
    .header-nav {
        order: 4;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #000000;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        border-bottom: 0px solid #1e3a8a;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }
    
    .header-nav.mobile-menu-open {
        max-height: 500px;
        padding: 10px 0;
        border-bottom-width: 2px;
    }
    
    .nav-link {
        width: 100%;
        padding: 12px 20px;
        border-radius: 0;
        border-left: 3px solid transparent;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
    }
    
    .nav-link i {
        width: 20px;
        text-align: center;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: #1e3a8a;
        border-left-color: #3b82f6;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }
    
    .header-logo img {
        height: 28px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .header-user {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* User Management Styles */
.users-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
    background: #ffffff;
    min-height: calc(100vh - 80px);
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1e3a8a;
}

.users-header h1 {
    color: #1e3a8a;
    margin: 0;
    font-size: 2rem;
}

.users-table-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(30, 58, 138, 0.1);
    border: 1px solid #1e3a8a;
    overflow-x: auto;
    overflow-y: visible;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem; /* Adjusted font size for tables */
}

.users-table thead {
    background: #1e3a8a;
    color: white;
}

.users-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #3b82f6;
}

.users-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.users-table tr:hover {
    background: #f8fafc;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.role-admin {
    background: #1e3a8a;
    color: white;
}

.role-badge.role-user {
    background: #3b82f6;
    color: white;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-active {
    background: #10b981;
    color: white;
}

.status-badge.status-inactive {
    background: #ef4444;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    margin: 0 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem; /* Adjusted font size for buttons */
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-small.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-small.btn-secondary:hover {
    background: #4b5563;
}

.btn-small.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #b91c1c;
}

.btn-small.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-small.btn-warning:hover {
    background: #d97706;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: linear-gradient(135deg, #111111 0%, #1f2937 100%);
    margin: 20px auto;
    padding: 0;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: calc(100vh - 40px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(30, 58, 138, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.8rem; /* Adjusted font size for modals */
}

.modal-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header i {
    font-size: 1.3rem;
    color: #93c5fd;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.modal form {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal .form-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px;
}

/* Form Styles for Modals */
.modal .form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.modal .form-group label {
    color: #e2e8f0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.modal .form-group label i {
    color: #3b82f6;
    font-size: 0.9rem;
}

.modal form input,
.modal form select,
.modal form textarea {
    color: #ffffff;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid #374151;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal form input:focus,
.modal form select:focus,
.modal form textarea:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
    background: rgba(31, 41, 55, 0.95);
}

.modal form input::placeholder,
.modal form textarea::placeholder {
    color: #9ca3af;
}

.modal form small {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 4px;
    font-style: italic;
}

/* Form Section Styles */
.form-section {
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(30, 58, 138, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.form-section h3 {
    color: #3b82f6;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h3 i {
    color: #60a5fa;
    font-size: 1rem;
}

/* Form Row Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Checkbox Styles */
.modal form input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #1e3a8a;
}

.modal form label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.modal form label:has(input[type="checkbox"]):hover {
    background: rgba(30, 58, 138, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid rgba(30, 58, 138, 0.3);
    background: linear-gradient(135deg, #111111 0%, #1f2937 100%);
    position: sticky;
    bottom: 0;
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 25px;
}

/* Responsive User Management */
@media (max-width: 768px) {
    .users-container {
        padding: 10px 10px 30px 10px;
        margin: 0;
    }
    
    .users-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .users-table {
        min-width: 600px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Multi-Chat Interface Styles */
.main-content {
    display: flex;
    height: calc(100vh - 80px);
    position: relative;
}

.chat-sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 2px solid #1e3a8a;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 80px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.chat-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    background: #1e3a8a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3b82f6;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-new-chat {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: black;
}

.chat-item {
    padding: 12px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-item:hover {
    background: #e3f2fd;
    border-color: #1e3a8a;
}

.chat-item.active {
    background: #1e3a8a;
    color: white;
}

.chat-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.chat-item-meta {
    font-size: 12px;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
}

.chat-item-actions {
    display: none;
    gap: 5px;
    margin-top: 8px;
}

.chat-item:hover .chat-item-actions {
    display: flex;
}

.chat-item.active .chat-item-actions {
    display: flex;
}

.chat-action-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.chat-item:not(.active) .chat-action-btn {
    background: #f3f4f6;
    color: #374151;
}

.chat-item.active .chat-action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-action-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.chat-container.sidebar-hidden {
    margin-left: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-name {
    color: #3b82f6;
    font-size: 0.9rem;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Responsive Multi-Chat */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 1001;
        top: 0;
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }
    
    .chat-sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .sidebar-header {
        padding: 1rem;
        min-height: 56px;
    }
    
    .sidebar-header h3 {
        font-size: 1rem;
    }
    
    .btn-new-chat {
        padding: 0.5rem;
        font-size: 0.9rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .chat-list {
        padding: 0.5rem;
    }
    
    .chat-item {
        padding: 1rem;
        margin-bottom: 0.5rem;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .chat-item h4 {
        font-size: 0.9rem;
    }
    
    .chat-item p {
        font-size: 0.8rem;
    }
    
    .main-content {
        position: relative;
    }
    
    .chat-container {
        margin-left: 0 !important;
    }
    
    .header-left h1 {
        display: none;
    }
    
    .header-user {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .username {
        font-size: 0.8rem;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .chat-sidebar {
        width: 85%;
        max-width: none;
    }
    
    .sidebar-header {
        padding: 0.75rem;
    }
    
    .chat-item {
        padding: 0.75rem;
        min-height: 44px;
    }
    
    .chat-item h4 {
        font-size: 0.85rem;
    }
    
    .chat-item p {
        font-size: 0.75rem;
    }
}

/* MFA (Multi-Factor Authentication) Styles */
.mfa-section {
    margin-top: 1rem;
    padding: 1.5rem;
    background: #1a1a1a;
    border: 1px solid #1e3a8a;
    border-radius: 8px;
}

.mfa-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.mfa-header i {
    font-size: 1.5rem;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.mfa-header h3 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.mfa-header p {
    color: #888;
    font-size: 0.9rem;
}

.help-text {
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: block;
}

/* Profile Page Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-section {
    background: #111111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-section h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    color: #888;
    font-weight: 500;
    min-width: 140px;
}

.info-item span {
    color: #fff;
    text-align: right;
}

.role-badge, .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.role-badge.admin {
    background: #dc2626;
    color: white;
}

.role-badge.user {
    background: #1e3a8a;
    color: white;
}

.status-badge.active {
    background: #16a34a;
    color: white;
}

.status-badge.inactive {
    background: #888;
    color: white;
}

/* MFA Status Styles */
.mfa-status {
    margin-top: 1rem;
}

.mfa-enabled, .mfa-disabled {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.mfa-enabled {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid #16a34a;
}

.mfa-disabled {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
}

.mfa-enabled i {
    color: #16a34a;
    font-size: 1.5rem;
}

.mfa-disabled i {
    color: #ef4444;
    font-size: 1.5rem;
}

.status-text {
    color: #fff;
    font-weight: 500;
    flex: 1;
}

.backup-codes-info {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.backup-codes-warning {
    color: #ef4444;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mfa-recommendation {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.mfa-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

/* MFA Setup Styles */
.mfa-setup-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: rgba(17, 17, 17, 0.95);
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(10px);
}

.mfa-setup-container > h2 {
    color: #dc2626;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
}

.setup-steps {
    display: grid;
    gap: 2.5rem;
}

.setup-step {
    display: flex;
    gap: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(55, 65, 81, 0.5);
    border-radius: 12px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.setup-step:hover {
    border-color: rgba(30, 58, 138, 0.5);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.2);
}

.step-number {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.step-content p {
    color: #9ca3af;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.app-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.app-list li {
    color: #fff;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid rgba(55, 65, 81, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.app-list li:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: #1e3a8a;
    transform: translateY(-2px);
}

.qr-code-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code {
    max-width: 256px;
    border: 2px solid #333;
    border-radius: 8px;
    background: white;
    padding: 1rem;
}

.qr-error {
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #ef4444;
    text-align: center;
}

.manual-entry {
    margin-top: 1rem;
}

.manual-entry summary {
    color: #1e3a8a;
    cursor: pointer;
    padding: 0.5rem;
}

.manual-setup {
    padding: 1rem;
    background: #1a1a1a;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.secret-key {
    display: block;
    background: #000;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    word-break: break-all;
    margin: 0.5rem 0;
}

.btn-copy {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-copy:hover {
    background: #1e40af;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.backup-code {
    display: block;
    background: #000;
    color: #fff;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1rem;
    text-align: center;
    border: 1px solid #333;
}

.backup-actions {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.backup-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 1rem;
    color: #ef4444;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #111111;
    margin: 10% auto;
    padding: 0;
    border: 1px solid #333;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    font-size: 0.8rem; /* Adjusted font size for modals */
}

.modal-header {
    background: #1e3a8a;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    color: #888;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Responsive Design for MFA */
@media (max-width: 768px) {
    .profile-container, .mfa-setup-container {
        padding: 1rem;
    }
    
    .setup-step {
        flex-direction: column;
        text-align: center;
    }
    
    .app-list {
        grid-template-columns: 1fr;
    }
    
    .backup-codes {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .info-item span {
        text-align: left;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* ===============================================
   ADMIN USAGE DASHBOARD STYLES
   =============================================== */

/* Navigation Bar */
.navbar {
    background: #000000;
    border-bottom: 3px solid #1e3a8a;
    padding: 0;
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-logo {
    height: 32px;  /* Much smaller logo */
    width: auto;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(30, 58, 138, 0.3);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.3);
}

.nav-link.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #3b82f6;
}

.nav-link i {
    font-size: 0.85rem;
}

/* Content Header Layout - positioned between nav and main content */
.content-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 1rem;
}

.content-header h1 {
    grid-column: 1;
    justify-self: start;
}

.content-header .tenant-indicator {
    grid-column: 2;
    justify-self: center;
}

.content-header .header-actions,
.content-header button,
.content-header .btn-primary {
    grid-column: 3;
    justify-self: end;
}

.content-header .header-title {
    grid-column: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Main Content Layout */
.main-content {
    background: #f8fafc;
    min-height: calc(100vh - 140px); /* Adjusted for header height */
    padding: 2rem;
}

.content-header h1 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-header h1 i {
    color: #1e3a8a;
    font-size: 1.75rem;
}

/* Tenant Indicator Styles */
.tenant-indicator {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tenant-indicator.super-admin {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.tenant-indicator.tenant-admin {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.tenant-indicator i {
    font-size: 1rem;
}

/* Tenant Badge Styles */
.tenant-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-right: 1.5rem; /* Add right margin for spacing */
}

.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    flex-shrink: 0;
}

.card-icon.tokens {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.card-icon.cost {
    background: linear-gradient(135deg, #10b981, #047857);
}

.card-icon.requests {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.card-icon.users {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.card-content h3 {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1;
}

.card-label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-container h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container h2::before {
    content: '📊';
    font-size: 1.25rem;
}

/* Table Container */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.table-header h2 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-input {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    font-size: 0.9rem;
    width: 250px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.table-wrapper {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem; /* Adjusted font size for tables */
}

.users-table thead {
    background: #f1f5f9;
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.users-table tr:hover {
    background: #f8fafc;
}

.user-info strong {
    color: #1e293b;
    font-weight: 600;
}

.user-details {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge.role-user {
    background: #dbeafe;
    color: #1e40af;
}

.badge.active {
    background: #d1fae5;
    color: #065f46;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.badge.tenant {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
}

.token-count, .request-count {
    font-weight: 600;
    color: #1e293b;
}

.cost-amount {
    font-weight: 600;
    color: #059669;
}

.quota-info {
    min-width: 120px;
}

.quota-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quota-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.timestamp {
    color: #6b7280;
    font-size: 0.8rem;
}

.no-activity {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-info {
    background: #0ea5e9;
    color: #ffffff;
}

.btn-info:hover {
    background: #0284c7;
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.flash-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.flash-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.flash-message.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #ffffff;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

/* Responsive Design for Dashboard */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .content-header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1rem;
        padding: 1rem 1.5rem;
    }
    
    .content-header h1,
    .content-header .header-title {
        grid-column: 1;
        justify-self: center;
    }
    
    .content-header .tenant-indicator {
        grid-column: 1;
        justify-self: center;
    }
    
    .content-header .header-actions,
    .content-header button,
    .content-header .btn-primary {
        grid-column: 1;
        justify-self: center;
    }
    
    .nav-container {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-logo {
        height: 28px;
    }
    
    .table-wrapper {
        font-size: 0.8rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .form-input {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .content-header {
        padding: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .card-value {
        font-size: 1.5rem;
    }
}

/* Token Info Modal Styles */
.token-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.token-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    margin: 3% auto;
    padding: 0;
    border: 1px solid #3b82f6;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.token-modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-bottom: 2px solid #3b82f6;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.token-modal-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.token-modal-header h2 i {
    color: #fbbf24;
}

.token-modal-close {
    color: #e2e8f0;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.token-modal-close:hover,
.token-modal-close:focus {
    color: #fbbf24;
    transform: scale(1.1);
}

.token-modal-body {
    padding: 2rem;
    color: #e2e8f0;
    max-height: 70vh;
    overflow-y: auto;
}

.token-info-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.token-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.token-info-section h3 {
    color: #3b82f6;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-info-section p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

.token-info-section ul {
    list-style: none;
    padding-left: 0;
}

.token-info-section ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.token-info-section ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #fbbf24;
    font-weight: bold;
}

.token-note {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.pricing-examples {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.pricing-item {
    background: rgba(30, 58, 138, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pricing-item strong {
    color: #fbbf24;
    font-size: 1.1rem;
}

.pricing-item span {
    color: #cbd5e1;
    font-size: 0.9rem;
    padding-left: 1rem;
}

.quota-info {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.3) 0%, rgba(30, 64, 175, 0.2) 100%);
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    padding: 1.5rem;
}

.quota-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.quota-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.quota-label {
    color: #94a3b8;
    font-weight: 500;
}

.quota-value {
    color: #fbbf24;
    font-weight: 600;
    font-size: 1.1rem;
}

.token-usage:hover {
    background: rgba(30, 58, 138, 0.4);
    border-color: rgba(251, 191, 36, 0.5);
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .token-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .token-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .token-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .token-modal-body {
        padding: 1.5rem;
    }
    
    .pricing-examples {
        gap: 0.75rem;
    }
}

/* MFA Alert Banner Styles */
.mfa-alert-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 3px solid #f59e0b;
    padding: 0.875rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
    z-index: 1001;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mfa-alert-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    width: 100%;
    color: #92400e;
}

.mfa-alert-content > i {
    font-size: 1.5rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.mfa-alert-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.mfa-alert-text strong {
    color: #78350f;
    font-weight: 600;
}

.mfa-alert-link {
    color: #0369a1;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.mfa-alert-link:hover {
    color: #075985;
}

.mfa-alert-close {
    background: none;
    border: none;
    color: #92400e;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 4px;
    flex-shrink: 0;
}

.mfa-alert-close:hover {
    background: rgba(146, 64, 14, 0.1);
    color: #78350f;
}

.mfa-alert-close i {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mfa-alert-banner {
        padding: 0.75rem 1rem;
    }
    
    .mfa-alert-content {
        gap: 0.75rem;
    }
    
    .mfa-alert-content > i {
        font-size: 1.25rem;
    }
    
    .mfa-alert-text {
        font-size: 0.85rem;
    }
}