:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --hour-height: 130px; /* Échelle normale aérée par défaut = 2.16px/min */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    font-size: 28px;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.app-header .subtitle {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 1rem;
}

.header-subrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.iteration-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iteration-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 11px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.iteration-tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.iteration-tab-btn.active {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
    box-shadow: 0 1px 3px rgba(4, 120, 87, 0.12);
}

.iteration-tab-btn .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.iteration-tab-btn.active .dot {
    background: #10b981;
}

.btn-new-iter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 9999px;
    border: 1px dashed #93c5fd;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-new-iter-pill:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

.new-iter-preview-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
}

.preview-story-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.preview-story-row.excluded {
    background: #f1f5f9;
    border-color: #e2e8f0;
    opacity: 0.65;
}

.preview-story-row .story-chk {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.preview-story-row .story-input {
    flex: 1;
    font-size: 0.82rem;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
}

.preview-story-row.excluded .story-input {
    background: #e2e8f0;
    color: #94a3b8;
    text-decoration: line-through;
}

.preview-story-row .btn-del-story {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.preview-story-row .btn-del-story:hover {
    opacity: 1;
    background: #fee2e2;
}

.preview-story-item code {
    font-family: inherit;
    font-weight: 600;
    color: #1e293b;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.iteration-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #475569;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 9999px;
    margin-top: 4px;
}

.iteration-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.simu-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Boutons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: #334155;
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-success {
    background: #059669;
    color: white;
}
.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: #dc2626;
    color: white;
}
.btn-danger:hover {
    background: #b91c1c;
}

.btn-real-push {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
.btn-real-push:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    color: #475569;
    cursor: pointer;
}
.btn-icon:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

/* Container Principal Full-Height */
.app-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    padding: 18px 24px;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 65px);
    max-width: 1750px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Sidebar avec défilement autonome propre */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 4px;
    min-height: 0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title-row h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

/* Dropzone */
.dropzone-card {
    border: 2px dashed #cbd5e1;
    background: #fafbfc;
    text-align: center;
    padding: 24px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropzone-card.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dropzone-card h3 {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 4px;
}

.drop-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.file-name {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 10px;
    word-break: break-all;
}

/* Résumé */
.badge-total {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.breakdown-section {
    margin-top: 18px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
}

.breakdown-section h4 {
    font-size: 0.84rem;
    color: #475569;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #94a3b8;
    font-size: 0.84rem;
}

.ticket-item-key {
    font-weight: 600;
    color: #1e293b;
}

.ticket-item-time {
    font-weight: 700;
    color: #0f172a;
}

/* Logs Anti-ubiquité */
.logs-card {
    background: #fffbeb;
    border-color: #fde68a;
}

.logs-intro {
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 8px;
}

.logs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.logs-list li {
    font-size: 0.78rem;
    color: #78350f;
    line-height: 1.4;
    padding: 6px 8px;
    background: rgba(254, 243, 199, 0.6);
    border-radius: 4px;
}

/* Calendrier */
.calendar-view {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.calendar-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    flex-shrink: 0;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-date-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-left: 8px;
}

.view-switch {
    display: flex;
    align-items: center;
    gap: 14px;
}

.scale-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 3px 5px;
    border-radius: 8px;
}

.scale-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    padding-left: 4px;
    user-select: none;
}

.scale-btn-group {
    display: flex;
    gap: 2px;
}

.btn-scale {
    padding: 4px 10px;
    font-size: 0.76rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-scale:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-scale.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-tab {
    padding: 6px 14px;
    font-size: 0.84rem;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
}
.btn-tab.active {
    background: var(--primary);
    color: white;
}

/* Empty State */
.empty-state {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-state h3 {
    font-size: 1.2rem;
    color: #334155;
    margin-bottom: 6px;
}

/* Grille Horaire avec Scroll libre et confortable occupant 100% de la hauteur */
.day-grid-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-height: 0;
    height: 100%;
    scroll-behavior: smooth;
    background: #ffffff;
}

/* Scrollbar moderne et lisible */
.day-grid-container::-webkit-scrollbar {
    width: 9px;
}
.day-grid-container::-webkit-scrollbar-track {
    background: #f8fafc;
    border-left: 1px solid #f1f5f9;
}
.day-grid-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 2px solid #f8fafc;
}
.day-grid-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 82px 1fr;
    position: relative;
    background: #ffffff;
    min-height: 100%;
}

.time-axis {
    border-right: 1px solid var(--border-color);
    background: #fafbfc;
    user-select: none;
}

.time-slot-hour {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 12px;
}

.time-label-main {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    text-align: right;
    transform: translateY(-8px);
}

.time-label-half {
    font-size: 0.70rem;
    color: #94a3b8;
    text-align: right;
    transform: translateY(-8px);
}

.events-canvas {
    position: relative;
    overflow: visible;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.grid-line-hour {
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.grid-line-half {
    border-bottom: 1px dashed #f1f5f9;
    box-sizing: border-box;
}

.events-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 16px;
    box-sizing: border-box;
    overflow: visible;
}

/* Bloc d'événement dans le calendrier */
.event-block {
    position: absolute;
    left: 16px;
    right: 24px;
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border-left-width: 5px;
    border-left-style: solid;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: default;
    box-sizing: border-box;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* SURVOL : Élévation nette sans déformer la carte */
.event-block:hover {
    z-index: 1000 !important;
    overflow: visible !important;
    box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.28), 0 6px 12px -2px rgba(15, 23, 42, 0.14) !important;
    outline: 2px solid rgba(37, 99, 235, 0.4);
}

/* Expansion maîtrisée pour les cartes compactes uniquement */
.event-block.event-compact:hover {
    height: auto !important;
    min-height: 48px;
    max-height: 90px;
}

.event-block.event-medium:hover {
    height: auto !important;
    min-height: 60px;
    max-height: 120px;
}

.event-block:hover .event-comment-truncated {
    display: none !important;
}

.event-block:hover .event-comment-full {
    display: block !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.event-block:hover .event-ticket-tag {
    display: flex !important;
    opacity: 1 !important;
}

.event-block:hover .event-extra-details {
    display: block !important;
}

/* Poignées de redimensionnement interactives */
.resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 30;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.resize-handle.handle-top {
    top: -6px;
}

.resize-handle.handle-bottom {
    bottom: -6px;
}

.resize-handle::before {
    content: '';
    width: 32px;
    height: 4px;
    background: currentColor;
    opacity: 0.25;
    border-radius: 9999px;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: scale(0.9);
}

.event-block:hover .resize-handle::before {
    opacity: 0.6;
}

.resize-handle:hover::before {
    opacity: 1 !important;
    transform: scale(1.25) !important;
}

/* État pendant le redimensionnement actif */
body.is-resizing {
    user-select: none !important;
    cursor: ns-resize !important;
}

body.is-resizing .event-block {
    pointer-events: none !important;
    transition: none !important;
}

.event-block.is-resizing {
    pointer-events: auto !important;
    z-index: 2500 !important;
    box-shadow: 0 0 0 3px #2563eb, 0 16px 32px rgba(37, 99, 235, 0.25) !important;
    outline: none !important;
    transition: none !important;
    overflow: hidden !important;
}

/* Tooltip flottant indiquant l'ajustement en direct */
.resize-tooltip {
    position: absolute;
    right: 32px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 3500;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resize-tooltip .diff-badge {
    background: #10b981;
    color: white;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.resize-tooltip .diff-badge.neg {
    background: #ef4444;
}

/* Ligne guide temporelle dynamique */
.timeline-guide-line {
    position: absolute;
    left: 82px;
    right: 0;
    height: 2px;
    background: #2563eb;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.7);
    z-index: 3000;
    pointer-events: none;
}

.timeline-guide-line::after {
    content: attr(data-time);
    position: absolute;
    left: -70px;
    top: -11px;
    background: #2563eb;
    color: white;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Ligne d'horaires et badge */
.event-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    flex-shrink: 0;
}

.event-time-span {
    white-space: nowrap;
}

.event-subtask-badge {
    font-size: 0.74rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-split-pill {
    background: #fef08a;
    color: #854d0e;
    font-size: 0.66rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

/* Titre Sous-tâche, Commentaire et Ticket */
.event-subtask-title {
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.event-subtask-pill {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.event-status-pill {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.event-comment-truncated {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.event-comment-full {
    display: none;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: #0f172a;
    margin-top: 4px;
}

.event-ticket-tag {
    margin-top: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mode Compact pour petits créneaux (< 38px) */
.event-block.event-compact {
    padding: 2px 8px;
    justify-content: center;
}

.event-block.event-compact .event-time-row {
    font-size: 0.71rem;
    gap: 6px;
}

.event-block.event-compact .event-comment-truncated {
    margin-top: 0;
    font-size: 0.74rem;
    font-weight: 500;
    color: #334155;
}

.event-block.event-compact .event-subtask-title {
    margin-top: 0;
    font-size: 0.74rem;
    font-weight: 600;
}

.event-block.event-compact .event-ticket-tag {
    display: none;
}

/* Mode Moyen (38px à 68px) */
.event-block.event-medium {
    padding: 4px 10px;
}

.event-block.event-medium .event-ticket-tag {
    display: none;
}

/* Modale */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-large {
    width: 900px;
}

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

.modal-header h2 {
    font-size: 1.15rem;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}
.input-text {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.88rem;
}

.simu-summary-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #166534;
    font-size: 0.9rem;
}

.simu-table-wrapper {
    overflow-x: auto;
}

.simu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.simu-table th, .simu-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.simu-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.category-cfg-row {
    display: grid;
    grid-template-columns: 28px 1fr 140px 32px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cat-color-badge-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cat-color-picker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1, 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
}

.btn-cat-color-picker:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px #3b82f6;
}

.cat-color-popover {
    position: absolute;
    top: 30px;
    left: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(4, 24px);
    gap: 8px;
    width: max-content;
    animation: fadeIn 0.15s ease-out;
}

.cat-color-popover-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease;
}

.cat-color-popover-item:hover {
    transform: scale(1.25);
    border-color: #0f172a;
}

.btn-edit-inline {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.15s ease;
    line-height: 1;
}

.btn-edit-inline:hover {
    opacity: 1;
    background: #eff6ff;
}

.category-title-line {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.category-keywords-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.category-cfg-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 4px solid transparent;
    padding-left: 8px;
}

.btn-delete-cat {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.7;
    transition: all 0.15s ease;
}

.btn-delete-cat:hover {
    opacity: 1;
    background: #fee2e2;
}

.add-custom-cat-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s ease-in-out;
}

.color-swatches-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.color-swatch-item {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.color-swatch-item:hover {
    transform: scale(1.15);
}

.color-swatch-item.active {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #ffffff inset;
    transform: scale(1.2);
}

/* User Badge & Profile Modal Styles */
.btn-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 5px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.btn-user-badge:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.user-trig-tag {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.user-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.user-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-tab-item:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.user-tab-item.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrapper input {
    padding-right: 40px;
    width: 100%;
}

.btn-toggle-pwd {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.btn-toggle-pwd:hover {
    opacity: 1;
}

.field-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 5px;
    line-height: 1.4;
}

.field-hint a {
    color: #2563eb;
    text-decoration: underline;
}

.status-pill-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    padding: 2px 9px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill-warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 9999px;
    padding: 2px 9px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-jira-id-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-top: 6px;
}

.user-jira-id-box .label {
    color: #64748b;
    font-weight: 500;
}

.user-jira-id-box code {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
    font-weight: 600;
}

.first-visit-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    margin-bottom: 16px;
    line-height: 1.45;
}

.generate-stories-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.confirm-push-summary-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

.confirm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confirm-summary-label {
    color: #64748b;
    font-weight: 500;
}

.confirm-summary-value {
    color: #0f172a;
    font-weight: 600;
}

.token-alert-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 10px;
    line-height: 1.4;
}

.simu-identity-strip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    flex-wrap: wrap;
    gap: 8px;
}

.simu-identity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1e293b;
}

.event-synced-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    padding: 1px 7px;
    border-radius: 9999px;
    margin-left: 6px;
}
