/* ============================================================
   Gestion Production - Main Stylesheet
   Material Design-inspired, factory floor optimized
   ============================================================ */

/* ----------------------------------------------------------
   CSS Variables
   ---------------------------------------------------------- */
:root {
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --primary-light: #BBDEFB;
    --secondary: #424242;
    --success: #4CAF50;
    --error: #F44336;
    --warning: #FF9800;
    --info: #2196F3;
    --background: #FAFAFA;
    --surface: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border: #E0E0E0;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
    padding-bottom: 32px; /* leave room for the fixed device banner */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------
   Device banner (fixed footer with current device name)
   ---------------------------------------------------------- */
.device-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    text-align: center;
    padding: 6px 12px;
    font-size: 13px;
    z-index: 6000;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

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

a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   Layout
   ---------------------------------------------------------- */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main-content {
    flex: 1;
    padding: 1rem;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

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

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

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */
#app-header {
    background-color: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
}

#app-header .header-title {
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#app-header .header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#app-header .header-nav a,
#app-header .header-nav button {
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-family);
    transition: background-color var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
}

#app-header .header-nav a:hover,
#app-header .header-nav button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

#app-header .header-user {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-right: 0.5rem;
}

/* ----------------------------------------------------------
   Navigation
   ---------------------------------------------------------- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    line-height: 1.5;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
    user-select: none;
    min-height: 48px;
    min-width: 48px;
    gap: 0.5rem;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* État "chargement" : masque le libellé et affiche un spinner centré.
   Utilisé notamment sur le bouton de connexion pendant l'initialisation
   (chargement i18n) pour indiquer à l'utilisateur que le bouton est inactif. */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: progress;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.1em;
    height: 1.1em;
    margin: -0.55em 0 0 -0.55em;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

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

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

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

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: var(--secondary);
}

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

.btn-danger:hover {
    background-color: #d32f2f;
    border-color: #d32f2f;
}

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

.btn-success:hover {
    background-color: #388E3C;
    border-color: #388E3C;
}

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

.btn-warning:hover {
    background-color: #F57C00;
    border-color: #F57C00;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 56px;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-height: 36px;
}

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

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

.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 48px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.form-input:disabled {
    background-color: #f5f5f5;
    opacity: 0.7;
    cursor: not-allowed;
}

.form-input::placeholder {
    color: #BDBDBD;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23757575' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background-color: #f5f5f5;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background-color: #f5f5f5;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

/* ----------------------------------------------------------
   Cards
   ---------------------------------------------------------- */
.card {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* ----------------------------------------------------------
   Dialog / Modal
   ---------------------------------------------------------- */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.dialog-content {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dialog-body {
    margin-bottom: 1.5rem;
}

.dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ----------------------------------------------------------
   Toast Notifications
   ---------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    animation: toast-slide-in 0.3s ease;
    min-height: 48px;
}

.toast-success {
    background-color: var(--success);
}

.toast-error {
    background-color: var(--error);
}

.toast-warning {
    background-color: var(--warning);
}

.toast-info {
    background-color: var(--info);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ----------------------------------------------------------
   Alert Messages
   ---------------------------------------------------------- */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-warning {
    background-color: #FFF3E0;
    color: #E65100;
    border-color: var(--warning);
}

.alert-error {
    background-color: #FFEBEE;
    color: #B71C1C;
    border-color: var(--error);
}

.alert-success {
    background-color: #E8F5E9;
    color: #1B5E20;
    border-color: var(--success);
}

.alert-info {
    background-color: #E3F2FD;
    color: #0D47A1;
    border-color: var(--info);
}

/* ----------------------------------------------------------
   Camera / Scanner Overlay
   ---------------------------------------------------------- */
.scanner-container {
    margin-bottom: 1.5rem;
}

.scanner-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.scanner-input {
    flex: 1;
    font-size: 1.125rem;
}

.camera-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.camera-overlay {
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-canvas {
    display: none;
}

.camera-scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-scan-zone {
    width: 280px;
    height: 180px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    position: relative;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.camera-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--error);
    animation: scan-line 2s linear infinite;
}

@keyframes scan-line {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.camera-hint {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    white-space: nowrap;
}

.camera-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 3001;
}

.camera-close-btn,
.camera-torch-btn {
    min-height: 56px;
    min-width: 56px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
}

.camera-close-btn:hover,
.camera-torch-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ----------------------------------------------------------
   Picking-specific Styles
   ---------------------------------------------------------- */
.picking-list {
    margin-bottom: 1.5rem;
}

.picking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
    gap: 1rem;
}

.picking-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.picking-item-done {
    border-color: var(--success);
    background-color: #E8F5E9;
}

.picking-item-done::before {
    content: "\2713";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--success);
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.picking-item-info {
    flex: 1;
    min-width: 0;
}

.picking-item-article {
    font-weight: 700;
    font-size: 1rem;
}

.picking-item-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picking-item-location {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
}

.picking-quantity {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    min-width: 80px;
    padding: 0.5rem;
}

.picking-item-qty {
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    min-width: 80px;
    white-space: nowrap;
}

.order-info-bar {
    background-color: var(--primary-light);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}

.order-info-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-article {
    font-weight: 700;
}

.confirm-area {
    position: sticky;
    bottom: 0;
    padding: 1rem 0;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* ----------------------------------------------------------
   Manager Overview Styles
   ---------------------------------------------------------- */
.week-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.week-nav-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem;
    font-size: 1.25rem;
}

.week-display {
    font-size: 1.25rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
}

.sync-btn {
    margin-left: auto;
}

.order-cancelled td {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.6;
}

.order-detail-panel {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid var(--primary);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
}

.order-detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.add-component-row {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ----------------------------------------------------------
   Status Badges / Pills
   ---------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    white-space: nowrap;
}

.status-pending {
    background-color: #FFF3E0;
    color: #E65100;
}

.status-validated {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.status-draft {
    background-color: #E3F2FD;
    color: #0D47A1;
}

.status-confirmed {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.status-cancelled {
    background-color: #FFEBEE;
    color: #B71C1C;
}

.status-active {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.status-locked {
    background-color: #FFEBEE;
    color: #B71C1C;
}

.status-authorized {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.status-revoked {
    background-color: #FFEBEE;
    color: #B71C1C;
}

.status-in-progress {
    background-color: #E3F2FD;
    color: #0D47A1;
}

.status-done {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.status-completed {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.status-not-started {
    background-color: #f5f5f5;
    color: var(--text-secondary);
}

/* ----------------------------------------------------------
   Login Container
   ---------------------------------------------------------- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 1rem;
}

.login-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

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

.login-logo h1 {
    color: var(--primary);
    font-size: 1.5rem;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.5rem;
}

.lang-btn {
    background: none;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    min-height: 40px;
}

.lang-btn:hover,
.lang-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.lang-separator {
    color: var(--border);
    font-size: 1.25rem;
}

/* ----------------------------------------------------------
   Code Input (Device Registration)
   ---------------------------------------------------------- */
.code-input {
    font-size: 2rem !important;
    text-align: center;
    letter-spacing: 0.5em;
    text-transform: uppercase;
}

.code-display-card {
    background-color: var(--primary-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.generated-code {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.code-expiry {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ----------------------------------------------------------
   Empty States
   ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ----------------------------------------------------------
   Loading Spinner
   ---------------------------------------------------------- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ----------------------------------------------------------
   Responsive Utilities
   ---------------------------------------------------------- */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Inline elements variant */
span.desktop-only,
a.desktop-only,
button.desktop-only {
    display: inline;
}

th.desktop-only,
td.desktop-only {
    display: table-cell;
}

/* ----------------------------------------------------------
   Role Matrix Table (checkboxes)
   ---------------------------------------------------------- */
#role-matrix-table td {
    text-align: center;
}

#role-matrix-table td:first-child {
    text-align: left;
    font-weight: 500;
}

#role-matrix-table input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ----------------------------------------------------------
   Parameters Table (editable inputs)
   ---------------------------------------------------------- */
#params-table .form-input {
    min-height: 40px;
    font-size: 1rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #BDBDBD;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9E9E9E;
}
