/*
 * FlexCore HR — components.css
 * Buttons, badges, cards, tables, forms, modals, alerts
 */

/* ─────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────── */
.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--fx-radius-sm);
    font-family: var(--fx-font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--fx-transition);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.fx-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.fx-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Sizes */
.fx-btn-xs {
    padding: 4px 10px;
    font-size: 11px;
}
.fx-btn-sm {
    padding: 6px 13px;
    font-size: 12px;
}
.fx-btn-lg {
    padding: 11px 24px;
    font-size: 15px;
}
.fx-btn-xl {
    padding: 14px 32px;
    font-size: 16px;
}
.fx-btn-icon {
    padding: 8px;
}
.fx-btn-icon.fx-btn-sm {
    padding: 6px;
}

/* Variants */
.fx-btn-primary {
    background: var(--fx-brand);
    color: #fff;
    border-color: var(--fx-brand);
}
.fx-btn-primary:hover {
    background: var(--fx-brand-light);
    border-color: var(--fx-brand-light);
    box-shadow: var(--fx-shadow-brand);
    transform: translateY(-1px);
}
.fx-btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.fx-btn-secondary {
    background: var(--fx-surface);
    color: var(--fx-text-body);
    border-color: var(--fx-border-strong);
}
.fx-btn-secondary:hover {
    background: var(--fx-surface-3);
    border-color: var(--fx-border-strong);
    color: var(--fx-text-primary);
}

.fx-btn-ghost {
    background: transparent;
    color: var(--fx-text-muted);
    border-color: transparent;
}
.fx-btn-ghost:hover {
    background: var(--fx-surface-3);
    color: var(--fx-text-body);
}

.fx-btn-danger {
    background: var(--fx-danger);
    color: #fff;
    border-color: var(--fx-danger);
}
.fx-btn-danger:hover {
    background: var(--fx-danger-text);
    border-color: var(--fx-danger-text);
}

.fx-btn-danger-ghost {
    background: transparent;
    color: var(--fx-danger-text);
    border-color: rgba(220, 38, 38, 0.3);
}
.fx-btn-danger-ghost:hover {
    background: var(--fx-danger-soft);
    border-color: var(--fx-danger);
}

.fx-btn-success {
    background: var(--fx-success);
    color: #fff;
    border-color: var(--fx-success);
}
.fx-btn-success:hover {
    background: var(--fx-success-text);
    border-color: var(--fx-success-text);
}

.fx-btn-brand-ghost {
    background: var(--fx-brand-soft);
    color: var(--fx-brand);
    border-color: var(--fx-brand-border);
}
.fx-btn-brand-ghost:hover {
    background: var(--fx-brand-mid);
}

/* ─────────────────────────────────────────────────
   BADGES
───────────────────────────────────────────────── */
.fx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--fx-radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.5;
    border: 1px solid transparent;
    white-space: nowrap;
}
.fx-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.fx-badge-sm {
    padding: 2px 7px;
    font-size: 10px;
}
.fx-badge-lg {
    padding: 5px 12px;
    font-size: 12px;
}

.fx-badge-primary {
    background: var(--fx-brand-soft);
    color: var(--fx-brand);
    border-color: var(--fx-brand-border);
}
.fx-badge-success {
    background: var(--fx-success-soft);
    color: var(--fx-success-text);
    border-color: rgba(22, 163, 74, 0.2);
}
.fx-badge-danger {
    background: var(--fx-danger-soft);
    color: var(--fx-danger-text);
    border-color: rgba(220, 38, 38, 0.2);
}
.fx-badge-warning {
    background: var(--fx-warning-soft);
    color: var(--fx-warning-text);
    border-color: rgba(217, 119, 6, 0.2);
}
.fx-badge-info {
    background: var(--fx-info-soft);
    color: var(--fx-info-text);
    border-color: rgba(37, 99, 235, 0.2);
}
.fx-badge-neutral {
    background: var(--fx-surface-3);
    color: var(--fx-text-muted);
    border-color: var(--fx-border);
}
.fx-badge-orange {
    background: var(--fx-orange-soft);
    color: var(--fx-orange);
    border-color: rgba(234, 88, 12, 0.2);
}
.fx-badge-pink {
    background: var(--fx-pink-soft);
    color: var(--fx-pink);
    border-color: rgba(219, 39, 119, 0.2);
}
.fx-badge-teal {
    background: var(--fx-teal-soft);
    color: var(--fx-teal);
    border-color: rgba(13, 148, 136, 0.2);
}

/* ─────────────────────────────────────────────────
   CARDS
───────────────────────────────────────────────── */
.fx-card {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    box-shadow: var(--fx-shadow-sm);
    overflow: hidden;
}

.fx-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--fx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.fx-card-title {
    font-family: var(--fx-font-display);
    font-size: 17px;
    letter-spacing: 1.2px;
    color: var(--fx-text-primary);
    line-height: 1;
}
.fx-card-subtitle {
    font-size: 12px;
    color: var(--fx-text-muted);
    margin-top: 3px;
}
.fx-card-body {
    padding: 20px;
}
.fx-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--fx-border);
    background: var(--fx-surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Stat cards */
.fx-stat-card {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    padding: 20px;
    box-shadow: var(--fx-shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--fx-transition);
}
.fx-stat-card:hover {
    box-shadow: var(--fx-shadow-md);
    transform: translateY(-2px);
}
.fx-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fx-brand);
    border-radius: var(--fx-radius-lg) var(--fx-radius-lg) 0 0;
}
.fx-stat-card.fx-success::before {
    background: var(--fx-success);
}
.fx-stat-card.fx-danger::before {
    background: var(--fx-danger);
}
.fx-stat-card.fx-warning::before {
    background: var(--fx-warning);
}
.fx-stat-card.fx-info::before {
    background: var(--fx-info);
}
.fx-stat-card.fx-teal::before {
    background: var(--fx-teal);
}

.fx-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--fx-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.fx-stat-icon svg {
    width: 22px;
    height: 22px;
}
.fx-stat-icon.fx-brand {
    background: var(--fx-brand-soft);
    color: var(--fx-brand);
}
.fx-stat-icon.fx-success {
    background: var(--fx-success-soft);
    color: var(--fx-success);
}
.fx-stat-icon.fx-danger {
    background: var(--fx-danger-soft);
    color: var(--fx-danger);
}
.fx-stat-icon.fx-warning {
    background: var(--fx-warning-soft);
    color: var(--fx-warning);
}
.fx-stat-icon.fx-info {
    background: var(--fx-info-soft);
    color: var(--fx-info);
}
.fx-stat-icon.fx-teal {
    background: var(--fx-teal-soft);
    color: var(--fx-teal);
}

.fx-stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fx-text-muted);
    margin-bottom: 6px;
}
.fx-stat-value {
    font-family: var(--fx-font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--fx-text-primary);
    line-height: 1;
    margin-bottom: 8px;
}
.fx-stat-change {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.fx-stat-change.fx-up {
    color: var(--fx-success-text);
}
.fx-stat-change.fx-down {
    color: var(--fx-danger-text);
}
.fx-stat-change svg {
    width: 13px;
    height: 13px;
}

/* ─────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────── */
.fx-table-wrap {
    overflow-x: auto;
    border-radius: var(--fx-radius-lg);
}
.fx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.fx-table thead tr {
    background: var(--fx-surface-2);
    border-bottom: 2px solid var(--fx-border);
}
.fx-table thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fx-text-muted);
    white-space: nowrap;
}
.fx-table tbody tr {
    border-bottom: 1px solid var(--fx-border);
    transition: background 0.12s;
}
.fx-table tbody tr:last-child {
    border-bottom: none;
}
.fx-table tbody tr:hover {
    background: var(--fx-surface-2);
}
.fx-table td {
    padding: 13px 16px;
    color: var(--fx-text-body);
    vertical-align: middle;
}
.fx-table .fx-td-primary {
    font-weight: 600;
    color: var(--fx-text-primary);
}
.fx-table .fx-td-muted {
    color: var(--fx-text-muted);
    font-size: 12px;
}

/* User cell */
.fx-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fx-user-cell .fx-avatar {
    flex-shrink: 0;
}
.fx-user-cell .fx-user-name {
    font-weight: 600;
    color: var(--fx-text-primary);
    font-size: 13px;
}
.fx-user-cell .fx-user-sub {
    font-size: 11px;
    color: var(--fx-text-muted);
}

/* ─────────────────────────────────────────────────
   AVATARS
───────────────────────────────────────────────── */
.fx-avatar {
    border-radius: 50%;
    background: var(--fx-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fx-font-display);
    color: #fff;
    flex-shrink: 0;
    font-size: 13px;
    overflow: hidden;
}
.fx-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fx-avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 10px;
}
.fx-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}
.fx-avatar {
    width: 40px;
    height: 40px;
    font-size: 15px;
}
.fx-avatar-md {
    width: 48px;
    height: 48px;
    font-size: 17px;
}
.fx-avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 22px;
}
.fx-avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 28px;
}
.fx-avatar-xxl {
    width: 96px;
    height: 96px;
    font-size: 34px;
}

/* Color variants */
.fx-avatar-success {
    background: var(--fx-success);
}
.fx-avatar-danger {
    background: var(--fx-danger);
}
.fx-avatar-warning {
    background: var(--fx-warning);
}
.fx-avatar-info {
    background: var(--fx-info);
}
.fx-avatar-teal {
    background: var(--fx-teal);
}
.fx-avatar-orange {
    background: var(--fx-orange);
}
.fx-avatar-pink {
    background: var(--fx-pink);
}
.fx-avatar-square {
    border-radius: var(--fx-radius-sm);
}

/* Stack */
.fx-avatar-stack {
    display: flex;
    align-items: center;
}
.fx-avatar-stack .fx-avatar {
    border: 2px solid var(--fx-surface);
    margin-left: -8px;
    box-shadow: 0 0 0 1px var(--fx-border);
}
.fx-avatar-stack .fx-avatar:first-child {
    margin-left: 0;
}
.fx-avatar-stack .fx-av-more {
    background: var(--fx-surface-3);
    color: var(--fx-text-muted);
    font-family: var(--fx-font-body);
    font-size: 10px;
    font-weight: 600;
}

/* ─────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────── */
.fx-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}
.fx-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--fx-text-muted);
}
.fx-label-normal {
    font-size: 13px;
    font-weight: 500;
    color: var(--fx-text-body);
    text-transform: none;
    letter-spacing: 0;
}
.fx-input,
.fx-select,
.fx-textarea {
    background: var(--fx-surface-2);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-sm);
    color: var(--fx-text-body);
    font-family: var(--fx-font-body);
    font-size: 14px;
    padding: 9px 13px;
    transition: var(--fx-transition);
    outline: none;
    width: 100%;
    line-height: 1.5;
}
.fx-input:focus,
.fx-select:focus,
.fx-textarea:focus {
    border-color: var(--fx-brand);
    background: var(--fx-surface);
    box-shadow: 0 0 0 3px var(--fx-brand-soft);
}
.fx-input::placeholder {
    color: var(--fx-text-faint);
}
.fx-textarea {
    resize: vertical;
    min-height: 90px;
}
.fx-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.fx-input-group {
    display: flex;
}
.fx-input-group .fx-input {
    border-radius: var(--fx-radius-sm) 0 0 var(--fx-radius-sm);
    flex: 1;
}
.fx-input-group .fx-btn {
    border-radius: 0 var(--fx-radius-sm) var(--fx-radius-sm) 0;
    border-left: none;
}
.fx-input-prefix {
    display: flex;
    align-items: center;
}
.fx-input-prefix-text {
    padding: 9px 12px;
    background: var(--fx-surface-3);
    border: 1px solid var(--fx-border);
    border-right: none;
    border-radius: var(--fx-radius-sm) 0 0 var(--fx-radius-sm);
    font-size: 13px;
    color: var(--fx-text-muted);
    white-space: nowrap;
}
.fx-input-prefix .fx-input {
    border-radius: 0 var(--fx-radius-sm) var(--fx-radius-sm) 0;
}

/* Helper & error text */
.fx-form-help {
    font-size: 11px;
    color: var(--fx-text-faint);
    margin-top: 3px;
}
.fx-form-error {
    font-size: 11px;
    color: var(--fx-danger-text);
    margin-top: 3px;
}
.fx-input.fx-error,
.fx-select.fx-error {
    border-color: var(--fx-danger);
}
.fx-input.fx-success {
    border-color: var(--fx-success);
}

/* Checkbox & Radio */
.fx-check-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.fx-check-group input[type="checkbox"],
.fx-check-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--fx-brand);
    cursor: pointer;
    flex-shrink: 0;
}
.fx-check-label {
    font-size: 13px;
    color: var(--fx-text-body);
    cursor: pointer;
}

/* 12-col form grid */
.fx-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.fx-col-1 {
    grid-column: span 1;
}
.fx-col-2 {
    grid-column: span 2;
}
.fx-col-3 {
    grid-column: span 3;
}
.fx-col-4 {
    grid-column: span 4;
}
.fx-col-5 {
    grid-column: span 5;
}
.fx-col-6 {
    grid-column: span 6;
}
.fx-col-7 {
    grid-column: span 7;
}
.fx-col-8 {
    grid-column: span 8;
}
.fx-col-9 {
    grid-column: span 9;
}
.fx-col-10 {
    grid-column: span 10;
}
.fx-col-11 {
    grid-column: span 11;
}
.fx-col-12 {
    grid-column: span 12;
}

/* ─────────────────────────────────────────────────
   MODALS
   Positions: center | top | bottom | right
   Sizes: sm(380) | default(520) | md(640) | lg(860) | xl(1060)
───────────────────────────────────────────────── */
.fx-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 500;
    padding: 20px;
    align-items: center;
    justify-content: center;
}
.fx-modal-overlay.fx-open {
    display: flex;
    animation: fxFadeIn 0.15s ease;
}
.fx-modal-overlay.fx-modal-top {
    align-items: flex-start;
    padding-top: 48px;
}
.fx-modal-overlay.fx-modal-bottom {
    align-items: flex-end;
    padding: 0;
}
.fx-modal-overlay.fx-modal-bottom .fx-modal {
    border-radius: var(--fx-radius-lg) var(--fx-radius-lg) 0 0;
    max-width: 100%;
    width: 100%;
    animation: fxSlideUpModal 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.fx-modal-overlay.fx-modal-right {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
}
.fx-modal-overlay.fx-modal-right .fx-modal {
    border-radius: var(--fx-radius-lg) 0 0 var(--fx-radius-lg);
    height: 100%;
    max-height: 100%;
    max-width: 480px;
    animation: fxSlideFromRight 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes fxSlideUpModal {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
@keyframes fxSlideFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.fx-modal {
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--fx-shadow-lg);
    animation: fxBounceIn 0.22s ease;
    display: flex;
    flex-direction: column;
}
.fx-modal-sm {
    max-width: 380px;
}
.fx-modal-md {
    max-width: 640px;
}
.fx-modal-lg {
    max-width: 860px;
}
.fx-modal-xl {
    max-width: 1060px;
}
.fx-modal-fullscreen {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
}

.fx-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--fx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--fx-surface-2);
}
.fx-modal-title {
    font-family: var(--fx-font-display);
    font-size: 22px;
    letter-spacing: 1.5px;
    color: var(--fx-text-primary);
}
.fx-modal-body {
    padding: 22px 24px;
    flex: 1;
    overflow-y: auto;
}
.fx-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--fx-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--fx-surface-2);
}
.fx-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fx-text-muted);
    font-size: 22px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--fx-radius-xs);
    transition: var(--fx-transition);
}
.fx-modal-close:hover {
    background: var(--fx-border);
    color: var(--fx-text-primary);
}

/* ─────────────────────────────────────────────────
   ALERTS / TOASTS
───────────────────────────────────────────────── */
.fx-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--fx-radius);
    border: 1px solid transparent;
    font-size: 13px;
}
.fx-alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.fx-alert-success {
    background: var(--fx-success-soft);
    border-color: rgba(22, 163, 74, 0.2);
    color: var(--fx-success-text);
}
.fx-alert-danger {
    background: var(--fx-danger-soft);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--fx-danger-text);
}
.fx-alert-warning {
    background: var(--fx-warning-soft);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--fx-warning-text);
}
.fx-alert-info {
    background: var(--fx-info-soft);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--fx-info-text);
}
.fx-alert-brand {
    background: var(--fx-brand-soft);
    border-color: var(--fx-brand-border);
    color: var(--fx-brand);
}

/* ─────────────────────────────────────────────────
   PROGRESS BARS
───────────────────────────────────────────────── */
.fx-progress {
    height: 6px;
    background: var(--fx-surface-3);
    border-radius: var(--fx-radius-pill);
    overflow: hidden;
}
.fx-progress-bar {
    height: 100%;
    border-radius: var(--fx-radius-pill);
    background: var(--fx-brand);
    transition: width 0.6s ease;
}
.fx-progress-bar.fx-success {
    background: var(--fx-success);
}
.fx-progress-bar.fx-danger {
    background: var(--fx-danger);
}
.fx-progress-bar.fx-warning {
    background: var(--fx-warning);
}
.fx-progress-sm {
    height: 4px;
}
.fx-progress-lg {
    height: 10px;
}

/* ─────────────────────────────────────────────────
   TABS
───────────────────────────────────────────────── */
.fx-tabs {
    border-bottom: 2px solid var(--fx-border);
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.fx-tab-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fx-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.18s;
    white-space: nowrap;
}
.fx-tab-btn::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fx-brand);
    opacity: 0;
    transition: opacity 0.18s;
}
.fx-tab-btn:hover {
    color: var(--fx-text-body);
}
.fx-tab-btn.fx-active {
    color: var(--fx-brand);
    font-weight: 600;
}
.fx-tab-btn.fx-active::after {
    opacity: 1;
}
.fx-tab-pane {
    display: none;
    animation: fxFadeUp 0.2s ease;
}
.fx-tab-pane.fx-active {
    display: block;
}

/* ─────────────────────────────────────────────────
   ACTIVITY / TIMELINE
───────────────────────────────────────────────── */
.fx-timeline {
    display: flex;
    flex-direction: column;
}
.fx-timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}
.fx-timeline-item:last-child {
    padding-bottom: 0;
}
.fx-timeline-item::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 0;
    width: 1px;
    background: var(--fx-border);
}
.fx-timeline-item:last-child::before {
    display: none;
}
.fx-timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--fx-surface);
    box-shadow: 0 0 0 1px var(--fx-border);
}
.fx-timeline-icon svg {
    width: 14px;
    height: 14px;
}
.fx-timeline-body {
    flex: 1;
    padding-top: 4px;
}
.fx-timeline-text {
    font-size: 13px;
    color: var(--fx-text-body);
    line-height: 1.4;
}
.fx-timeline-text strong {
    color: var(--fx-text-primary);
    font-weight: 600;
}
.fx-timeline-time {
    font-size: 11px;
    color: var(--fx-text-faint);
    margin-top: 3px;
}

/* ─────────────────────────────────────────────────
   Buttons
───────────────────────────────────────────────── */
.fx-file-zone {
    border: 2px dashed var(--fx-border);
    border-radius: var(--fx-radius-lg);
    background: var(--fx-surface-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.fx-file-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.fx-file-zone:hover,
.fx-file-zone.fx-drag-over {
    border-color: var(--fx-brand);
    background: var(--fx-brand-soft);
}
.fx-file-zone.fx-drag-over {
    box-shadow: 0 0 0 4px var(--fx-brand-soft);
}
.fx-file-zone-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--fx-radius);
    background: var(--fx-surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: all 0.2s;
    color: var(--fx-text-faint);
}
.fx-file-zone:hover .fx-file-zone-icon,
.fx-file-zone.fx-drag-over .fx-file-zone-icon {
    background: var(--fx-brand-mid);
    color: var(--fx-brand);
}
.fx-file-zone-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fx-text-primary);
    margin-bottom: 4px;
}
.fx-file-zone-title span {
    color: var(--fx-brand);
    text-decoration: underline;
}
.fx-file-zone-sub {
    font-size: 12px;
    color: var(--fx-text-faint);
    line-height: 1.5;
}
.fx-file-zone-types {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.fx-file-type-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--fx-font-mono);
    padding: 2px 8px;
    border-radius: var(--fx-radius-pill);
    background: var(--fx-surface-3);
    color: var(--fx-text-muted);
    border: 1px solid var(--fx-border);
    text-transform: uppercase;
}

/* Size variants */
.fx-file-zone-sm {
    padding: 20px 18px;
}
.fx-file-zone-sm .fx-file-zone-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}
.fx-file-zone-sm .fx-file-zone-title {
    font-size: 13px;
}

/* State: has file */
.fx-file-zone.fx-has-file {
    border-style: solid;
    border-color: var(--fx-success);
    background: rgba(22, 163, 74, 0.04);
}
.fx-file-zone.fx-has-file .fx-file-zone-icon {
    background: rgba(22, 163, 74, 0.12);
    color: var(--fx-success);
}

/* State: error */
.fx-file-zone.fx-file-error {
    border-color: var(--fx-danger);
    background: var(--fx-danger-soft);
}
.fx-file-zone.fx-file-error .fx-file-zone-icon {
    background: rgba(220, 38, 38, 0.1);
    color: var(--fx-danger);
}

/* Compact inline file input */
.fx-file-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fx-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-sm);
    background: var(--fx-surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--fx-text-body);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.15s;
    white-space: nowrap;
}
.fx-file-btn:hover {
    background: var(--fx-surface-2);
    border-color: var(--fx-brand-border);
    color: var(--fx-brand);
}
.fx-file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.fx-file-name {
    font-size: 13px;
    color: var(--fx-text-muted);
    font-style: italic;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-file-name.chosen {
    color: var(--fx-text-body);
    font-style: normal;
    font-weight: 500;
}

/* File list (multi-upload) */
.fx-file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fx-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-sm);
    transition: var(--fx-transition);
}
.fx-file-item:hover {
    border-color: var(--fx-brand-border);
}
.fx-file-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--fx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--fx-font-mono);
    color: #fff;
}
.fx-file-item-icon.pdf {
    background: #dc2626;
}
.fx-file-item-icon.img {
    background: #7c3aed;
}
.fx-file-item-icon.doc {
    background: #2563eb;
}
.fx-file-item-icon.xls {
    background: #16a34a;
}
.fx-file-item-icon.other {
    background: var(--fx-text-muted);
}
.fx-file-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--fx-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-file-item-size {
    font-size: 11px;
    color: var(--fx-text-faint);
    font-family: var(--fx-font-mono);
    flex-shrink: 0;
}
.fx-file-item-remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--fx-text-faint);
    transition: all 0.12s;
    flex-shrink: 0;
}
.fx-file-item-remove:hover {
    background: var(--fx-danger-soft);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--fx-danger);
}
.fx-file-item-remove svg {
    width: 11px;
    height: 11px;
}

/* Upload progress */
.fx-file-item-progress {
    margin-top: 5px;
}
.fx-upload-bar {
    height: 3px;
    background: var(--fx-surface-3);
    border-radius: 99px;
    overflow: hidden;
}
.fx-upload-fill {
    height: 100%;
    background: var(--fx-brand);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* Avatar / image uploader */
.fx-avatar-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.fx-avatar-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.fx-avatar-upload-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--fx-brand-soft);
    border: 3px solid var(--fx-surface);
    box-shadow: 0 0 0 2px var(--fx-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s;
}
.fx-avatar-upload:hover .fx-avatar-upload-img {
    box-shadow: 0 0 0 2px var(--fx-brand);
}
.fx-avatar-upload-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(62, 0, 124, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
}
.fx-avatar-upload:hover .fx-avatar-upload-overlay {
    opacity: 1;
}
.fx-avatar-upload-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 22px;
    height: 22px;
    background: var(--fx-brand);
    border-radius: 50%;
    border: 2px solid var(--fx-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fx-avatar-upload-badge svg {
    color: #fff;
}

/* ─────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────── */
.fx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.fx-empty-icon {
    width: 56px;
    height: 56px;
    background: var(--fx-surface-3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--fx-text-faint);
}
.fx-empty-icon svg {
    width: 26px;
    height: 26px;
}
.fx-empty h4 {
    font-size: 15px;
    color: var(--fx-text-primary);
    margin-bottom: 6px;
}
.fx-empty p {
    font-size: 13px;
    color: var(--fx-text-muted);
    margin-bottom: 18px;
    max-width: 280px;
}

/* ─────────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────────── */
.fx-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fx-page-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--fx-radius-xs);
    border: 1px solid var(--fx-border);
    background: var(--fx-surface);
    color: var(--fx-text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--fx-transition);
    font-family: var(--fx-font-body);
}
.fx-page-btn:hover {
    background: var(--fx-surface-3);
    color: var(--fx-text-primary);
    border-color: var(--fx-border-strong);
}
.fx-page-btn.fx-active {
    background: var(--fx-brand);
    color: #fff;
    border-color: var(--fx-brand);
}
.fx-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────
   RESPONSIVE HELPERS
───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .fx-form-grid > * {
        grid-column: span 12 !important;
    }
    .fx-modal,
    .fx-modal-sm,
    .fx-modal-md,
    .fx-modal-lg,
    .fx-modal-xl {
        max-width: 100%;
    }
}
