/* AccountsServices - CSS Production v3.1 - Clean Version */
/* Bonetti SRL - 2024 */
/* CSS ottimizzato contenente solo gli stili utilizzati */

/* === BASE E RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.site-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
    color: white;
}

.site-title .version {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 300;
}

.main-nav {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-item {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.nav-item i {
    margin-right: 6px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-right: 140px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Status Sistema nella Topbar */
.system-status {
    display: flex;
    flex-direction: column;
    gap: 2px;                       /* Ridotto da 1px a 2px per compattare */
    padding: 6px 14px;              /* Ridotto padding verticale da 8px a 6px */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;             /* Ridotto da 8px a 6px */
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;               /* Mantiene larghezza */
    width: 180px;                   /* Larghezza fissa mantenuta */
    text-align: left;
    border: 1px solid #dadce0;
    margin-left: auto;              /* Allinea a destra */
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;             /* Ridotto da 6px a 3px */
    padding: 2px 0;                 /* Ridotto da 4px a 2px */
    gap: 10px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    font-size: 0.7rem;              /* Ridotto da 0.75rem */
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;                 /* Aggiunto per ridurre altezza */
}

.status-indicator,
.status-value {
    font-size: 0.8rem;              /* Ridotto da 0.85rem */
    font-weight: bold;
    white-space: nowrap;
    line-height: 1;                 /* Aggiunto per ridurre altezza */
}

.status-indicator {
    padding: 2px 6px;               /* Ridotto padding da 2px 8px */
    border-radius: 3px;             /* Ridotto da 4px */
    background: rgba(0, 0, 0, 0.05);
}

/* === TOGGLE NOTIFICHE TOPBAR === */
.notification-toggle-container {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 6px !important;
    margin-bottom: 6px !important;
}

.notification-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e74c3c;
    white-space: nowrap;
}

.notification-toggle-btn i {
    font-size: 0.9rem;
}

.notification-toggle-btn:hover {
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.notification-toggle-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.notification-toggle-btn.active:hover {
    background: linear-gradient(135deg, #218838 0%, #17a589 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.notification-toggle-text {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    font-weight: 800;
}

/* Animazione pulsante notifica attivo */
.notification-toggle-btn.active i {
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* === PULSANTE FLOATING NOTIFICHE (in basso a destra) === */
.notification-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9999;
    font-size: 1.5rem;
}

.notification-floating-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 30px rgba(231, 76, 60, 0.6);
}

.notification-floating-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
}

.notification-floating-btn.active:hover {
    box-shadow: 0 6px 30px rgba(40, 167, 69, 0.6);
}

.notification-floating-btn i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.notification-floating-btn .notification-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: -2px;
}

/* Animazione campanella quando attivo */
.notification-floating-btn.active i {
    animation: bellRing 2s ease-in-out infinite;
}

/* Pulse animation per richiamare attenzione quando OFF */
.notification-floating-btn:not(.active) {
    animation: pulseSlow 3s ease-in-out infinite;
}

@keyframes pulseSlow {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    }
    50% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.7);
    }
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    padding: 30px 0;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.messages-container {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

/* === TYPOGRAPHY === */
h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #2c3e50;
}

p {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.lead {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* === HOMEPAGE STYLES === */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.user-session-info {
    margin-top: 40px;
}

.session-card {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 10px;
    padding: 25px;
}

.session-details {
    display: grid;
    gap: 10px;
}

.session-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.session-item:last-child {
    border-bottom: none;
}

.session-label {
    font-weight: 600;
    color: #1976d2;
}

.session-value {
    color: #2c3e50;
    font-weight: 500;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 3px 10px rgba(149, 165, 166, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    color: white;
    text-decoration: none;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #117a8b;
    color: white;
    text-decoration: none;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}
.form-control,
.form-select,
input[type="text"],
input[type="search"],
input[type="date"],
input[type="email"],
input[type="number"],
textarea
{
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.2;
    min-height: 40px; /* ensure consistent height */
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* small compact controls */
.form-control-sm,
.form-select-sm,
input.form-control-sm,
select.form-select-sm {
    padding: 6px 10px;
    min-height: 34px;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
    padding: 4px 8px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.password-toggle:hover {
    opacity: 1;
    color: #3498db;
    background-color: #f8f9fa;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* === ALERTS === */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border-left: 4px solid;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.validation-summary {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.validation-summary.show,
.validation-summary:not(:empty) {
    display: block;
}

.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

/* === LOGIN PAGE === */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
}

.login-container h1 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

.alert-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-login:hover {
    background: linear-gradient(135deg, #5a67d8, #6b5b95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-login:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === LOGIN SISTEMA INFO === */
.system-info-section {
    margin-top: 25px;
    padding: 18px;
    background: #f1f3f4;
    border-radius: 12px;
    text-align: left;
    border: 1px solid #dadce0;
}

.system-status-row,
.api-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.system-status-row:last-child,
.api-status-row:last-child {
    margin-bottom: 0;
}

/* === DOCUMENTATION PAGE === */
.doc-page {
    background: #f8f9fa;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.doc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.doc-header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 30px;
}

.doc-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.doc-header h1 i {
    color: #667eea;
    margin-right: 15px;
}

.doc-subtitle {
    color: #6c757d;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.doc-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: #28a745; color: white; }
.badge-info { background: #17a2b8; color: white; }
.badge-warning { background: #ffc107; color: #212529; }

.doc-nav {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.doc-nav h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.doc-section {
    margin-bottom: 50px;
}

.doc-section h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.doc-section h2 i {
    color: #667eea;
    margin-right: 12px;
}

.section-desc {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-style: italic;
}

.endpoint-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.endpoint-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.endpoint-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.method {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: center;
}

.method.get { background: #28a745; color: white; }
.method.post { background: #007bff; color: white; }
.method.put { background: #ffc107; color: #212529; }
.method.delete { background: #dc3545; color: white; }

.path {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    background: #e9ecef;
    padding: 6px 12px;
    border-radius: 4px;
    flex-grow: 1;
}

.status {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.public { background: #d4edda; color: #155724; }
.status.protected { background: #fff3cd; color: #856404; }
.status.private { background: #f8d7da; color: #721c24; }

.endpoint-body {
    padding: 20px;
}

.endpoint-body p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.endpoint-test {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.endpoint-test h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.test-params {
    margin-bottom: 15px;
}

.test-result {
    margin-top: 15px;
    display: none;
}

.result {
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result pre {
    background: rgba(0,0,0,0.05);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.request-body, .endpoint-response, .validation-rules, .query-params, .code-example {
    margin: 20px 0;
}

.request-body h4, .endpoint-response h4, .validation-rules h4, .query-params h4, .code-example h4 {
    color: #495057;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.request-body pre, .endpoint-response pre, .code-example pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.4;
}

.validation-rules ul, .query-params ul {
    list-style: none;
    padding: 0;
}

.validation-rules li, .query-params li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.validation-rules li:last-child, .query-params li:last-child {
    border-bottom: none;
}

.integration-guide {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    border-left: 4px solid #28a745;
}

.integration-guide h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.mb-2 {
    margin-bottom: 8px;
}

.doc-footer {
    background: #2c3e50;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    border-radius: 8px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.footer-info p {
    margin-bottom: 5px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === FOOTER === */
.site-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0 10px;
    margin-top: auto;
}

.footer-bottom {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 10px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* === BROKERS DASHBOARD === */
.brokers-dashboard-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-top: 4px solid #667eea;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c3e50;
}

.dashboard-header h2 i {
    color: #667eea;
    margin-right: 10px;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.refresh-indicator i {
    color: #28a745;
    font-size: 0.8rem;
}

.brokers-list {
    min-height: 200px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    color: #667eea;
    min-height: 200px;
}

.loading-spinner i {
    font-size: 1.5rem;
}

.no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 150px;
    font-size: 1.1rem;
    color: #6c757d;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-data i {
    font-size: 2rem;
    opacity: 0.5;
}

.no-brokers-available {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 250px;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    animation: fadeIn 0.4s ease-in;
}

.no-brokers-icon {
    font-size: 3.5rem;
    color: #adb5bd;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.no-brokers-available h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #495057;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.no-brokers-available p {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
}

.no-brokers-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #e7f3ff;
    border-left: 4px solid #0066cc;
    border-radius: 6px;
    color: #004085;
    font-size: 0.95rem;
    margin-top: 10px;
    max-width: 400px;
}

.no-brokers-hint i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* === NUMERIC / MONETARY ALIGNMENT === */
/* Ensure monetary and numeric values (lots, amounts, counts, slots, etc.) are right-aligned across the site */
.table td.col-amount,
.table th.col-amount,
.table td.col-number,
.table th.col-number,
.table td[data-slot],
.table td.text-end,
.table th.text-end,
.numeric,
.col-amount,
.col-number {
    text-align: right !important;
    /* Use tabular numbers for consistent digit width */
    font-variant-numeric: tabular-nums;
}

/* Smaller right padding for numeric cells to separate from separators */
.table td.col-amount,
.table td.col-number,
.table td[data-slot] {
    padding-right: 0.75rem;
}

/* For small numeric badges inside cells keep centered vertically */
.table td.col-amount > span,
.table td.col-number > span {
    display: inline-block;
    min-width: 1ch;
}

/* === UTILITY HELPERS (USED BY PAGES) === */
.d-none { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; }

/* Simple spinner style used on pages (lightweight replacement for Bootstrap) */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25rem solid rgba(0,0,0,0.1);
    border-right-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Text color helper */
.text-primary { color: #3498db !important; }

/* Layout helper for single-line controls */
.controls-inline {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: nowrap;
}
.controls-inline .form-select { min-width: 220px; }

/* small responsive tweak to allow wrap on narrow screens */
@media (max-width: 576px) {
    .controls-inline { flex-wrap: wrap; align-items: stretch; }
    .controls-inline .form-select { width: 100%; }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 991px) {
    /* Reduce container widths and paddings on smaller desktops/tablets */
    .header-container, .main-container, .messages-container, .footer-bottom, .doc-container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    .site-title h1 { font-size: 1.1rem; }
    .site-title .version { display: none; }
    .system-status {
        min-width: auto;
        width: auto;
        padding: 6px 8px;
    }
    .user-section { margin-right: 0; }
}

@media (max-width: 575px) {
    /* Mobile specific tweaks */
    html { font-size: 15px; }

    .logo { width: 38px; height: 38px; font-size: 1rem; }
    .site-title h1 { font-size: 1rem; }
    .main-content { padding: 16px 0; }
    .main-container { padding: 18px 12px; border-radius: 10px; }

    /* Make status items more compact */
    .status-item { gap: 6px; }
    .status-label { font-size: 0.65rem; }
    .status-indicator, .status-value { font-size: 0.75rem; }

    /* Floating notification button smaller on phones */
    .notification-floating-btn {
        bottom: 18px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    /* Dashboard cards stack better on mobile */
    .brokers-dashboard-container { padding: 16px; margin: 20px 0; }

    /* Hide non-critical elements to save space */
    .site-title .version, .no-brokers-hint { display: none; }
}

/* Improve table / grid responsiveness globally */
@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
}

/* Ensure footer text wraps nicely */
@media (max-width: 480px) {
    .footer-bottom small { font-size: 0.7rem; }
}

/* No-JS warning style moved from inline to CSS */
.no-js-warning {
    background: #fff3bf;
    padding: 10px;
    text-align: center;
    color: #6c5a00;
    border: 1px solid #ffe58a;
}

/* Replace inline test-result background colors by utility classes */
.result-success {
    color: #155724;
    background: #d4edda;
}
.result-error {
    color: #721c24;
    background: #f8d7da;
}

/* Replace inline loading display toggles with utility class */
.hidden { display: none !important; }
/* Status helper classes to replace inline color styles */
.status-online { color: #28a745 !important; }
.status-offline { color: #dc3545 !important; }
.status-warning { color: #f39c12 !important; }

/* Class to mark logging out animation */
.logging-out { transition: opacity 0.5s ease; opacity: 0.5; }

/* Alert utilities */
.flex-alert { display: flex; align-items: center; gap: 10px; }
.alert-icon { font-weight: bold; margin-right: 6px; }
.fade-out { opacity: 0; transition: opacity 0.5s ease; }

.loading { opacity: 0.7; pointer-events: none; }

/* Styles for alarm disarmed state */
.notification-floating-btn.alarm-disarm {
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
    right: 100px; /* shifted left of main floating button */
    background: #6c757d;
    box-shadow: none;
}

.notification-floating-btn.alarm-disarm i {
    color: #ffffff;
}

.notification-floating-btn.alarm-disarm .notification-badge {
    font-size: 0.6rem;
    color: #ffffff;
}

/* When disarmed, visually mute the main notification button too */
.notification-floating-btn.disarmed,
.notification-floating-btn.alarm-disarm.disarmed {
    background: #adb5bd !important;
    box-shadow: none !important;
    cursor: default;
    transform: none !important;
    animation: none !important;
    opacity: 0.85;
}

/* Ensure disarmed badge shows DIS */
.notification-floating-btn.alarm-disarm .notification-badge { font-weight: 800; }