/* ================================================
   Admin Dashboard - CSS
   ================================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border: #475569;
    --border-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
    --sidebar-width: 240px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--accent-hover);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ================================================
   LOGIN PAGE
   ================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo svg {
    opacity: 0.9;
}

.login-title {
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.btn-block {
    width: 100%;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-align: center;
}

.sidebar-logo svg {
    flex-shrink: 0;
}

.sidebar-logo img {
    height: auto;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    margin: 0.125rem 0.5rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-item.active svg {
    stroke: var(--accent);
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* --- Mobile Toggle --- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ================================================
   TABLES
   ================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

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

thead th {
    text-transform: uppercase;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    white-space: nowrap;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:nth-child(odd) {
    background: var(--bg-primary);
}

tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.table-actions {
    display: flex;
    gap: 0.375rem;
}

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

.form-group label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    line-height: 1.5;
    transition: border-color var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

input[type="color"] {
    height: 38px;
    padding: 2px;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

input[type="color"]:focus {
    border-color: var(--accent);
    outline: none;
}

/* --- Two-column form layout --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.required-mark {
    color: var(--danger);
    font-weight: 600;
    margin-left: 0.125rem;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1.5rem 0;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

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

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* ================================================
   BADGES
   ================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-inactive {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-admin {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ================================================
   STATUS CONFIG SECTION
   ================================================ */
.status-config-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-config-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
    position: relative;
}

.status-config-card.is-collapsed {
    padding: 0.625rem 1rem;
}

.status-config-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.status-config-card.drop-before {
    box-shadow: 0 -3px 0 0 var(--primary, #3b82f6);
}

.status-config-card.drop-after {
    box-shadow: 0 3px 0 0 var(--primary, #3b82f6);
}

.status-config-card[draggable="true"] {
    cursor: default;
}

.status-config-header {
    display: grid;
    grid-template-columns: auto auto auto 1fr auto auto auto;
    gap: 0.625rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.status-config-card.is-collapsed .status-config-header {
    margin-bottom: 0;
}

.status-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    padding: 0.25rem;
    border-radius: 4px;
    user-select: none;
}
.status-drag-handle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.status-drag-handle:active { cursor: grabbing; }

.status-position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.status-color-preview {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.status-config-name-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.status-config-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-config-subname {
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.status-chip {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-chip-muted {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.status-chip-info { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-chip-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-chip-success { background: rgba(16,185,129,0.15); color: #10b981; }

.btn-collapse-toggle {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-collapse-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-delete-status {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-delete-status:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.status-config-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.125rem 0.5rem;
    flex-wrap: wrap;
}

.status-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.status-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.status-action-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 4px;
    display: flex;
    transition: all var(--transition);
}

.status-action-item .remove-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ================================================
   TOAST
   ================================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease forwards;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-info {
    border-left: 3px solid var(--accent);
}

.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
}

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

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ================================================
   LOADING OVERLAY
   ================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   BRANDING PREVIEW
   ================================================ */
.branding-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.branding-preview-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.preview-mockup {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-mockup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.preview-mockup-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.preview-mockup-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.preview-mockup-pill {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.preview-mockup-bar {
    height: 6px;
    border-radius: 3px;
    width: 60%;
}

/* ================================================
   UTILITY CLASSES
   ================================================ */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

/* ================================================
   SIDEBAR FOOTER ACTIONS
   ================================================ */
.sidebar-footer-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-light);
}

.sidebar-footer-actions .btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.sidebar-footer-actions .btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ================================================
   MODAL
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

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

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

/* --- Project search list in modal --- */
.project-search-list {
    max-height: 300px;
    overflow-y: auto;
}

.project-search-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
    cursor: pointer;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    font-family: var(--font);
}

.project-search-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* ================================================
   PROFILE CARDS
   ================================================ */
.profile-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-cards {
        grid-template-columns: 1fr;
    }

    .toast-container {
        right: 0.5rem;
        left: 0.5rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .status-config-header {
        grid-template-columns: auto auto auto 1fr auto auto;
        row-gap: 0.375rem;
    }
    .status-chips { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .table-container {
        font-size: 0.8125rem;
    }

    thead th,
    tbody td {
        padding: 0.5rem 0.625rem;
    }
}

/* ===== Jira user lookup no user-form ===== */
.jira-user-lookup { position: relative; }
.jira-user-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.375rem;
  max-height: 240px;
  overflow-y: auto;
}
.jira-user-results:empty { display: none; }
.jira-user-item {
  text-align: left;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #475569);
  color: var(--text-primary, #f1f5f9);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}
.jira-user-item:hover { background: var(--bg-hover, #3b4a63); border-color: var(--accent, #3b82f6); }
.jira-user-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #475569);
  border-radius: 4px;
  font-size: 0.875rem;
}
.jira-user-selected .btn-sm { padding: 0.125rem 0.5rem; font-size: 1rem; line-height: 1; }

/* ===== Rich Text Editor (reutilizado do cliente) ===== */
.rich-editor { border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); overflow: hidden; position: relative; }
.rich-editor:focus-within { border-color: var(--accent); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.375rem 0.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); align-items: center; }
.rich-toolbar button, .rich-toolbar .rich-select { background: none; border: 1px solid transparent; border-radius: 4px; padding: 0.25rem 0.5rem; cursor: pointer; color: var(--text-primary); font-size: 0.8125rem; line-height: 1; min-width: 1.75rem; }
.rich-toolbar button:hover, .rich-toolbar .rich-select:hover { background: var(--bg-primary); border-color: var(--border); }
.rich-toolbar .rich-select { font-size: 0.75rem; padding: 0.25rem 0.375rem; }
.rich-sep { display: inline-block; width: 1px; height: 18px; background: var(--border); margin: 0 0.25rem; }
.rich-content { min-height: 100px; padding: 0.625rem 0.75rem; color: var(--text-primary); outline: 0; font-size: 0.875rem; line-height: 1.5; max-height: 320px; overflow-y: auto; }
.rich-content:empty::before, .rich-editor.is-empty .rich-content::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rich-content p { margin: 0 0 0.5rem 0; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h2, .rich-content h3 { margin: 0.5rem 0 0.375rem 0; color: var(--text-primary); }
.rich-content h2 { font-size: 1.125rem; }
.rich-content h3 { font-size: 1rem; }
.rich-content ul, .rich-content ol { padding-left: 1.5rem; margin: 0.25rem 0; }
.rich-content blockquote { border-left: 3px solid var(--border); padding-left: 0.75rem; color: var(--text-muted); margin: 0.5rem 0; }
.rich-content pre { background: var(--bg-secondary); padding: 0.5rem 0.75rem; border-radius: 4px; font-family: monospace; font-size: 0.8125rem; overflow-x: auto; }
.rich-content a { color: var(--accent); }
.rich-content img { max-width: 200px; max-height: 120px; height: auto; }
.rich-emoji-picker { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 0.125rem; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.3); max-width: 280px; z-index: 10; }
.emoji-btn { background: none; border: 0; font-size: 1.125rem; cursor: pointer; padding: 0.25rem; border-radius: 4px; }
.emoji-btn:hover { background: var(--bg-secondary); }
.rich-link-popover { position: absolute; z-index: 10001; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 0.5rem; }
.rich-link-popover-row { display: flex; gap: 0.375rem; align-items: center; }
.rich-link-popover input { padding: 0.375rem 0.5rem; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 0.8125rem; min-width: 220px; outline: none; }
.rich-link-popover input:focus { border-color: var(--accent); }
.rich-link-popover .rich-link-ok { background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: 0.375rem 0.625rem; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.rich-link-popover .rich-link-cancel { background: none; border: 0; color: var(--text-muted); font-size: 1.125rem; cursor: pointer; padding: 0 0.25rem; line-height: 1; }
