/* ============================================
   OPCP AiPoweredStore - Professional Design System
   Inspired by SkillHub / OVHcloud branding
   ============================================ */

/* CSS Custom Properties */
:root {
    --color-primary: #000E9C;
    --color-primary-hover: #0012c4;
    --color-accent: #4949FF;
    --color-accent-light: #6b6bff;
    --color-background: #f5f6fa;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;
    --color-border: #e2e8f0;
    --color-border-light: #edf2f7;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #2980b9;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "Fira Code", "Cascadia Code", "Consolas", monospace;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-background);
    min-height: 100vh;
    font-size: 16px;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: var(--color-primary);
    color: #ffffff;
    padding: 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10000;
    height: 56px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    color: #ffffff;
    text-decoration: none;
    transition: opacity var(--transition);
    letter-spacing: -0.02em;
}

.nav-title:hover {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.nav-links a.nav-active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
}

.nav-user {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.lang-btn {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.lang-btn.active {
    background: var(--color-accent);
    color: #ffffff;
    font-weight: 600;
    border-color: var(--color-accent);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--color-surface);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    border-radius: var(--radius);
    top: 100%;
    left: 0;
    border: 1px solid var(--color-border);
    margin-top: 0.25rem;
}

.nav-dropdown-content a {
    color: var(--color-text) !important;
    padding: 0.6rem 1rem;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875rem;
    transition: background var(--transition);
}

.nav-dropdown-content a:hover {
    background-color: var(--color-background);
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-content a,
.mobile-nav-content .nav-user {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    text-align: left;
    transition: background var(--transition);
    font-size: 0.9rem;
}

.mobile-nav-content a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav .lang-btn {
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
}

.mobile-nav .lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.mobile-nav .lang-btn.active {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: calc(100vh - 200px);
    border: 1px solid var(--color-border);
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-container {
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    gap: 1.5rem;
}

.platform-header {
    background: var(--color-primary);
    color: #ffffff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.platform-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.platform-header h3 {
    margin-bottom: 1rem;
    opacity: 0.85;
    font-weight: 400;
    font-size: 1.1rem;
}

.mission-statement {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--color-accent);
}

.auth-form {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-weight: 600;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font-sans);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(73, 73, 255, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    font-family: var(--font-sans);
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

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

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

.btn-secondary {
    background: var(--color-text-secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    background: #3d4a5c;
}

.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-success {
    background: var(--color-success);
    color: #ffffff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-info {
    background: var(--color-info);
    color: #ffffff;
}

.btn-info:hover {
    background: #2471a3;
}

.btn-warning {
    background: var(--color-warning);
    color: #ffffff;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    margin: 0 0.15rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: #ffffff;
    background-color: var(--color-primary);
    transition: all var(--transition);
    font-weight: 500;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background-color: var(--color-primary-hover);
}

.btn-small:active {
    transform: translateY(0);
}

.btn-small:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn:disabled,
.btn[style*="pointer-events: none"] {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    opacity: 0.7;
}

.btn-icon:hover {
    background: var(--color-background);
    opacity: 1;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.auth-link a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-container h2 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.applications-grid {
    margin-bottom: 2rem;
    margin-top: 0;
    width: 100%;
}

/* ============================================
   APPLICATIONS TABLE (list-grid layout)
   ============================================ */
.applications-table {
    width: 100%;
    border-collapse: collapse;
}

.applications-table th,
.applications-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
    vertical-align: middle;
}

.applications-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.applications-table tbody tr:hover {
    background: var(--color-background);
}

.applications-table .app-id {
    width: 40px;
    color: var(--color-text-muted);
    font-family: monospace;
}

.applications-table .app-name strong {
    color: var(--color-text);
    font-size: 0.9rem;
}

.applications-table .app-description {
    color: var(--color-text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.applications-table .app-branch .gitea-info {
    margin: 0;
    padding: 0;
    background: none;
}

.applications-table .app-branch .gitea-branch-select {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    max-width: 140px;
}

.applications-table .app-version {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.applications-table .app-table-actions {
    white-space: nowrap;
}

.applications-table .app-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.applications-table .app-action-buttons .btn-small {
    font-size: 0.75rem;
    padding: 3px 8px;
    white-space: nowrap;
}

/* ============================================
   APP CARDS (table row styling)
   ============================================ */
.app-card {
    transition: background-color var(--transition);
}

.app-card:hover {
    background: var(--color-background);
}

.app-card .app-card-name {
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.app-actions {
    display: flex;
    gap: 0.2rem;
}

.no-apps {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.add-app-section {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
    border: 1px solid var(--color-border);
}

.add-app-section h3 {
    margin-bottom: 1rem;
    color: var(--color-text);
    font-weight: 600;
}

.add-app-form {
    max-width: 500px;
}

/* ============================================
   TABS
   ============================================ */
.admin-menu, .user-menu {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
}

.tab-btn {
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-weight: 500;
}

.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-btn:hover {
    color: var(--color-accent);
}

.tab-content {
    margin-top: 0.75rem;
    vertical-align: top;
    align-self: flex-start;
    width: 100%;
}

/* ============================================
   TABLES
   ============================================ */
.users-grid {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875rem;
}

.users-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.users-table tr:hover {
    background: var(--color-background);
}

.loading {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

.user-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0.75rem 0;
    border: 1px solid var(--color-border);
}

.user-form input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.user-form button {
    margin: 0.5rem 0.5rem 0 0;
}

/* ============================================
   SERVERS
   ============================================ */
.servers-grid {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th,
.servers-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875rem;
}

.servers-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.servers-table tr:hover {
    background: var(--color-background);
}

.server-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0.75rem 0;
    border: 1px solid var(--color-border);
}

.server-form input,
.server-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.server-form button {
    margin: 0.5rem 0.5rem 0 0;
}

/* Status indicators */
.status-active {
    color: var(--color-success);
    font-weight: 600;
}

.status-suspended {
    color: var(--color-danger);
    font-weight: 600;
}

.status-standby {
    color: var(--color-warning);
    font-weight: 600;
}

.server-active {
    background-color: #eafaf1 !important;
}

/* ============================================
   VIRTUAL AGENTS PANEL
   ============================================ */
.virtual-agents-panel {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-primary);
    color: #ffffff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agent-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}

.agent-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    margin-bottom: -1px;
}

.agent-tab:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.agent-tab.active {
    background: var(--color-surface);
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

.agent-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.app-selection, .operations-controls {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
}

.app-selection select, .operations-controls select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

/* Required field highlighting for Virtual Agents selects */
#unifiedAppSelect {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: 2px solid var(--color-success) !important;
}

#unifiedAction {
    background: var(--color-success) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: 2px solid var(--color-warning) !important;
}

#unifiedAppSelect option, #unifiedAction option {
    background: white !important;
    color: var(--color-text) !important;
    font-weight: normal !important;
}

.operations-controls {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.operations-controls select {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
}

/* Unified controls */
.unified-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    height: auto;
    align-items: center;
}

.unified-controls select {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-sizing: border-box;
    font-size: 0.85rem;
}

.unified-controls .toggle-btn {
    flex-shrink: 0;
}

/* Messages area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--color-background);
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    max-height: 400px;
}

.messages-area::-webkit-scrollbar {
    width: 5px;
}

.messages-area::-webkit-scrollbar-track {
    background: var(--color-border-light);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

.message {
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    line-height: 1.4;
    border-left: 3px solid var(--color-border);
}

.message.user {
    background: #eef2ff;
    border-left-color: var(--color-accent);
    margin-left: 15%;
}

.message.system {
    background: var(--color-background);
    color: var(--color-text-muted);
    font-style: italic;
    border-left-color: var(--color-info);
}

.message.developer-assistant, .message.operations-assistant {
    background: #f8f9ff;
    color: var(--color-text);
    border-left-color: var(--color-primary);
    margin-right: 15%;
}

.message.assistant {
    background: #f3f0ff;
    border-left-color: var(--color-accent);
    margin-right: 15%;
}

.message.devops-assistant {
    background: #fff8f0;
    border-left-color: var(--color-warning);
    margin-right: 15%;
}

.message.error {
    background: #fef2f2;
    color: var(--color-danger);
    border-left-color: var(--color-danger);
}

.message-content {
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Input area */
.input-area {
    padding: 0.75rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.input-area textarea {
    width: 100%;
    min-height: 50px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    resize: none;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    margin-bottom: 0.5rem;
}

.input-area textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(73, 73, 255, 0.1);
}

.input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.input-controls button {
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition);
}

.input-controls button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.input-controls button:active {
    transform: translateY(0);
}

.virtual-agents-panel.collapsed .panel-content {
    display: none;
}

.virtual-agents-panel.collapsed {
    height: auto;
}

/* Virtual Agents QChat Output Styling */
.virtual-agents-panel .message-content {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.3;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.virtual-agents-panel .developer-assistant .message-content,
.virtual-agents-panel .devops-assistant .message-content,
.virtual-agents-panel .operations-assistant .message-content {
    background: #1e1e2e !important;
    border: 1px solid #313244 !important;
    border-radius: var(--radius) !important;
    padding: 0.5rem !important;
    min-height: 40px !important;
    font-family: var(--font-mono) !important;
    font-size: 0.75rem !important;
    color: #cdd6f4 !important;
}

/* ============================================
   APP MANAGEMENT
   ============================================ */
.app-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0.75rem 0;
    border: 1px solid var(--color-border);
}

.app-form h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.apps-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 0.75rem 0;
}

.available-apps, .assigned-apps {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.available-apps h4, .assigned-apps h4 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.app-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

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

.app-item span {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Deployment styles */
.app-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.deployment-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.4rem;
}

.actions {
    white-space: nowrap;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--color-surface);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    resize: both;
    min-width: 400px;
    min-height: 300px;
}

.modal-header {
    background: var(--color-primary);
    color: #ffffff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.close {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-body {
    padding: 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.deployment-info {
    background: var(--color-background);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border-light);
}

.deployment-info p {
    margin: 0.3rem 0;
    font-size: 0.875rem;
}

/* Status colors */
.status-pending {
    color: var(--color-warning);
    font-weight: 600;
}

.status-running {
    color: var(--color-info);
    font-weight: 600;
}

.status-completed {
    color: var(--color-success);
    font-weight: 600;
}

.status-failed, .status-error, .status-clone_failed, .status-clone_error {
    color: var(--color-danger);
    font-weight: 600;
}

.status-cloning {
    color: var(--color-warning);
    font-weight: 600;
}

.status-cloned {
    color: var(--color-success);
    font-weight: 600;
}

.status-timeout {
    color: #e67e22;
    font-weight: 600;
}

/* ============================================
   LOGS
   ============================================ */
#logsContent {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.logs-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
}

.logs-section h3 {
    margin: 0 0 0.75rem 0;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 600;
}

.logs-section h3:before {
    content: '📋';
}

.logs-controls {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.logs-content {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    min-height: 150px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #313244;
    margin: 0;
}

/* ============================================
   AI CHAT
   ============================================ */
.chat-toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: var(--color-primary);
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 999;
    transition: all var(--transition);
}

.chat-toggle:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--color-background);
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--color-border);
    font-size: 0.85rem;
}

.chat-user {
    background: #eef2ff;
    border-left-color: var(--color-accent);
    margin-left: 15%;
}

.chat-assistant {
    background: #f3f0ff;
    border-left-color: var(--color-primary);
    margin-right: 15%;
}

.chat-system {
    background: #fffbeb;
    border-left-color: var(--color-warning);
    font-style: italic;
}

.chat-error {
    background: #fef2f2;
    border-left-color: var(--color-danger);
}

.chat-output {
    background: #ecfdf5;
    border-left-color: var(--color-success);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chat-input-area textarea {
    resize: none;
    min-height: 50px;
}

.chat-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ============================================
   PLATFORM DESCRIPTION (Login page)
   ============================================ */
.platform-description {
    background: var(--color-surface);
    color: var(--color-text);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.target-audience, .platform-features {
    margin-bottom: 1.5rem;
}

.target-audience h4, .platform-features h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.target-audience ul, .platform-features ul {
    list-style: none;
    padding: 0;
}

.target-audience li, .platform-features li {
    margin-bottom: 0.6rem;
    padding-left: 0.5rem;
    line-height: 1.5;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.revolution-message {
    background: #fffbeb;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.warning-text {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
    color: var(--color-text);
}

/* ============================================
   LEGAL FOOTER
   ============================================ */
.legal-footer {
    background: var(--color-primary);
    color: #ffffff;
    padding: 1.25rem 0;
    margin-top: 2rem;
    text-align: center;
}

.legal-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.copyright {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    opacity: 0.75;
}

.team-credits {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
}

.team-credits strong {
    color: var(--color-accent-light);
}

.platform-info {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============================================
   BILLING
   ============================================ */
.billing-submenu {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.billing-tab-content {
    margin-top: 0.75rem;
}

.invoice-generation {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.invoice-generation h4 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.invoices-list {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.invoices-list h4 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.status-paid {
    background-color: var(--color-success);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-unpaid {
    background-color: var(--color-danger);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.billing-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    gap: 0.75rem;
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
}

.period-selector, .user-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-selector label, .user-selector label {
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    font-size: 0.85rem;
}

.period-selector select, .user-selector select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    min-width: 120px;
}

.billing-summary, .billing-activities {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
}

.billing-summary h3, .billing-activities h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.billing-table th,
.billing-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
}

.billing-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.billing-table tr:hover {
    background: var(--color-background);
}

.billing-table tfoot th {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
}

.action-start, .action-START {
    background-color: var(--color-success);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.action-stop, .action-STOP {
    background-color: var(--color-danger);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.cost-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0.75rem 0;
    border: 1px solid var(--color-border);
}

.cost-form h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.costs-table {
    width: 100%;
    border-collapse: collapse;
}

.costs-table th,
.costs-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
}

.costs-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
}

.cost-input {
    width: 100px;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-align: right;
    font-size: 0.85rem;
}

/* ============================================
   DATABASE MANAGEMENT
   ============================================ */
.database-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.database-controls label {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.85rem;
}

.database-controls select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    min-width: 200px;
}

.table-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--color-border);
}

.database-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.database-table th,
.database-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}

.database-table th {
    background: var(--color-background);
    font-weight: 600;
    color: var(--color-text);
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.database-table tr:hover {
    background: var(--color-background);
}

.database-table td {
    max-width: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.record-form {
    background: var(--color-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0.75rem 0;
    max-width: 600px;
    border: 1px solid var(--color-border);
}

.record-form h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.record-form .form-group {
    margin-bottom: 0.75rem;
}

.record-form .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

.record-form .form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.record-form .form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(73, 73, 255, 0.1);
}

.record-form .form-group input[readonly] {
    background-color: var(--color-background);
    color: var(--color-text-muted);
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-layout {
    display: flex;
    height: calc(100vh - 80px);
    gap: 1rem;
    max-width: 100%;
    margin: 0;
    padding: 1rem;
}

.dashboard-layout.vertical {
    flex-direction: column;
}

.main-panel {
    flex: 1;
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    border: 1px solid var(--color-border);
}

.agents-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-layout.vertical .agents-panel {
    flex: 1;
    min-width: auto;
    min-height: 300px;
}

.dashboard-container {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.dashboard-container .admin-menu,
.dashboard-container .user-menu {
    flex-shrink: 0;
}

.dashboard-container .tab-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-content: flex-start;
}

/* Ensure all tab sections start at the top */
#billingSection,
#usersSection,
#serversSection,
#databaseSection,
#logsSection {
    margin-top: 0;
    padding-top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

#billingSection h2,
#usersSection h2,
#serversSection h2,
#databaseSection h2,
#logsSection h2 {
    margin-top: 0;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .nav-title {
        font-size: 1.1rem;
    }

    .nav-center {
        display: none;
    }

    .lang-toggle {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .mobile-nav.active .lang-toggle {
        display: flex;
        justify-content: center;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .applications-grid {
        overflow-x: auto;
    }

    .applications-table {
        min-width: 700px;
    }

    .applications-table th,
    .applications-table td {
        white-space: nowrap;
    }

    .main-content {
        margin: 0.75rem;
        padding: 1rem;
        border-radius: var(--radius);
    }

    /* Mobile tables */
    .users-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .users-table {
        font-size: 0.8rem;
        min-width: 800px;
    }

    .users-table th,
    .users-table td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .servers-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .servers-table {
        min-width: 900px;
    }

    .servers-table th,
    .servers-table td {
        white-space: nowrap;
    }

    .deployment-buttons {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        min-width: auto;
    }

    .apps-management {
        grid-template-columns: 1fr;
    }

    .logs-section {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }

    .logs-controls {
        flex-wrap: wrap;
    }

    .chat-toggle {
        bottom: 10px;
        right: 10px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .chat-messages {
        height: 280px;
    }

    .chat-user {
        margin-left: 10%;
    }

    .chat-assistant {
        margin-right: 10%;
    }

    /* Mobile virtual agents panel */
    .virtual-agents-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 55vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 80vh;
    }

    .messages-area {
        min-height: 200px !important;
        max-height: 280px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .unified-controls {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .unified-controls select {
        width: 100%;
        padding: 0.6rem;
        font-size: 16px;
        box-sizing: border-box;
    }

    #unifiedAppSelect,
    #unifiedAction {
        width: 100% !important;
        font-size: 16px !important;
        padding: 0.6rem !important;
        box-sizing: border-box !important;
    }

    /* Mobile billing */
    .billing-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .period-selector, .user-selector {
        justify-content: center;
        width: 100%;
    }

    .period-selector select, .user-selector select {
        flex: 1;
        min-width: auto;
    }

    .billing-table {
        font-size: 0.8rem;
    }

    .billing-table th,
    .billing-table td {
        padding: 0.4rem 0.5rem;
    }

    .costs-table {
        font-size: 0.8rem;
    }

    .cost-input {
        width: 80px;
    }

    /* Mobile database */
    .database-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .database-controls select {
        min-width: auto;
    }

    .table-container {
        padding: 0.75rem;
        overflow-x: scroll;
    }

    .database-table {
        font-size: 0.75rem;
        min-width: 800px;
    }

    .database-table th,
    .database-table td {
        padding: 0.4rem 0.5rem;
    }

    .record-form {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    /* Mobile auth */
    .auth-container {
        padding: 0.75rem;
        gap: 1rem;
    }

    .platform-header {
        padding: 1.25rem;
    }

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

    .platform-description {
        padding: 1rem;
    }

    .legal-footer {
        padding: 0.75rem 0;
        margin-top: 1.5rem;
    }

    .legal-content {
        padding: 0 0.75rem;
    }

    .copyright, .team-credits {
        font-size: 0.7rem;
    }
}

/* ============================================
   FOCUS & ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Logout link */
.nav-links a.nav-logout {
    color: #ff6b6b;
}

.nav-links a.nav-logout:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff4444;
}

.mobile-nav-content a.nav-logout {
    color: #ff6b6b;
}

/* Scrollbar global */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-border-light);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Selection */
::selection {
    background: rgba(73, 73, 255, 0.15);
    color: var(--color-text);
}

/* Readonly fields in view modals */
.readonly-field {
    padding: 0.4rem 0.6rem;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--color-text);
    word-break: break-all;
}

.readonly-field a {
    color: var(--color-accent);
    text-decoration: none;
}

.readonly-field a:hover {
    text-decoration: underline;
}

/* Time estimation boxes */
.time-estimation {
    background: var(--color-background);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin: 0.75rem 0;
    border: 1px solid var(--color-border-light);
}

.estimate-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.estimate-label {
    color: var(--color-text-muted);
    font-weight: 500;
}

.estimate-value {
    color: var(--color-text);
    font-weight: 600;
}

/* Gitea info box in app cards */
.gitea-info {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--color-background);
    border-radius: var(--radius);
    font-size: 0.75rem;
    border: 1px solid var(--color-border-light);
}

/* Activation notice */
.activation-notice {
    background: #fffbeb;
    border: 1px solid var(--color-warning);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
}

/* ============================================
   JOB STATUS BADGES (Serverless)
   ============================================ */
.job-status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: capitalize;
    white-space: nowrap;
    color: #ffffff;
}

.job-status-badge.status-pending {
    background-color: #6c757d;
    color: #ffffff;
}

.job-status-badge.status-running {
    background-color: #007bff;
    color: #ffffff;
}

.job-status-badge.status-completed {
    background-color: #28a745;
    color: #ffffff;
}

.job-status-badge.status-failed {
    background-color: #dc3545;
    color: #ffffff;
}

.job-status-badge.status-timeout {
    background-color: #fd7e14;
    color: #ffffff;
}

.job-status-badge.status-cancelled {
    background-color: #ffc107;
    color: #212529;
}
