/**
 * CORSINI STORE - CALENDARIO TURNI
 * Sistema di gestione turni per negozi
 * Versione ottimizzata con variabili CSS
 */

/* ========================================
   CSS VARIABLES - Colori e Dimensioni
   ======================================== */

:root {
    /* Colori Principali */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #f0f4ff;
    
    /* Colori Stato */
    --success-color: #28a745;
    --success-light: #d4edda;
    --danger-color: #dc3545;
    --danger-light: #f8d7da;
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --info-color: #17a2b8;
    --info-light: #d1ecf1;
    
    /* Colori Turni */
    --shift-morning: #28a745;
    --shift-lunch: #ffc107;
    --shift-afternoon: #17a2b8;
    --shift-evening: #6f42c1;
    
    /* Colori Neutri */
    --grey-dark: #6c757d;
    --grey: #666;
    --grey-light: #f8f9fa;
    --grey-border: #ddd;
    --grey-text: #999;
    
    /* Colori Negozi */
    --store-showroom: #3498db;
    --store-runway: #e67e22;
    --store-t55: #9b59b6;
    --store-t61: #2ecc71;
    
    /* Colori Sistema */
    --white: #ffffff;
    --black: #333333;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --overlay: rgba(0, 0, 0, 0.5);
    
    /* Dimensioni */
    --border-radius: 8px;
    --border-radius-small: 5px;
    --transition-speed: 0.3s;
    --navbar-height: 70px;
    --sidebar-width: 300px;
}

/* ========================================
   RESET E BASE
   ======================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--grey-light);
    color: var(--black);
    line-height: 1.6;
}

/* Skip to main content - Accessibilità */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 var(--border-radius-small) 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--warning-color);
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
}

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

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 15px;
}

.login-logo img {
    max-width: 100px;
    height: auto;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 24px;
}

/* ========================================
   FORM ELEMENTS - Elementi Form Comuni
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--grey);
    font-size: 14px;
}

.form-group input,
.form-control,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    font-size: 14px;
    transition: all var(--transition-speed);
    font-family: inherit;
}

.form-group input:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.required {
    color: var(--danger-color);
    font-weight: 700;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--grey);
}

.form-help a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.form-help a:hover {
    text-decoration: underline;
}

/* ========================================
   ALERT MESSAGES - Messaggi Sistema
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: var(--success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: var(--danger-light);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: var(--info-light);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========================================
   BUTTONS - Pulsanti Sistema
   ======================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--grey-dark);
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

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

.btn-warning:hover {
    background: #ffb300;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-logout {
    background: var(--danger-color);
    color: var(--white);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-logout:hover {
    background: #c82333;
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
    min-width: 250px;
}

/* ========================================
   NAVBAR - Barra Navigazione
   ======================================== */

.navbar {
    background: var(--white);
    padding: 12px 30px;
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-height);
}

/* Left Section - Logo e Menu */
.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--grey);
    padding: 8px;
    transition: color var(--transition-speed);
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    border-radius: var(--border-radius-small);
}

.logo {
    height: 40px;
    width: auto;
}

/* Center Section - Title */
.nav-center {
    flex: 1;
    text-align: center;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    color: #003399;
    margin: 0;
}

.nav-brand {
    display: none;
}

/* Right Section - User Info */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.user-name {
    font-size: 14px;
    color: var(--black);
    font-weight: 600;
}

/* User Role Badges */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
}

.badge-owner {
    background: var(--warning-light);
    color: #856404;
}

.badge-admin {
    background: var(--info-light);
    color: #0c5460;
}

.badge-employee {
    background: var(--success-light);
    color: #155724;
}

/* Legacy - Hidden */
.nav-menu,
.user-info {
    display: none;
}

/* ========================================
   SIDEBAR MENU - Menu Laterale
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    box-shadow: 2px 0 10px var(--shadow);
    transition: left var(--transition-speed) ease;
    z-index: 1001;
    overflow-y: auto;
    will-change: left;
}

.sidebar.active {
    left: 0;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: var(--grey-light);
}

.sidebar-header h3 {
    margin: 0;
    color: var(--black);
    font-size: 20px;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--grey);
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-speed);
}

.sidebar-close:hover {
    color: var(--danger-color);
}

.sidebar-close:focus {
    outline: 2px solid var(--danger-color);
    border-radius: var(--border-radius-small);
}

/* Sidebar Menu Items */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    color: var(--black);
    text-decoration: none;
    transition: all var(--transition-speed);
}

.sidebar-menu li a:hover {
    background: var(--grey-light);
    padding-left: 25px;
}

.sidebar-menu li a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.sidebar-menu li a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.sidebar-menu li a span {
    font-size: 15px;
    font-weight: 500;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: #dee2e6;
    margin: 10px 0;
    border: none;
}

/* Sidebar Logout Link */
.sidebar-logout {
    color: var(--danger-color) !important;
}

.sidebar-logout:hover {
    background: #fff5f5 !important;
}

.sidebar-logout i {
    color: var(--danger-color) !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--overlay);
    z-index: 1000;
    display: none;
    cursor: pointer;
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   MAIN CONTENT - Contenuto Principale
   ======================================== */

.main-content {
    padding: 30px;
    min-height: calc(100vh - var(--navbar-height) - 60px);
}

/* ========================================
   CALENDAR - Calendario Turni
   ======================================== */

/* Calendar Controls - Navigation e Pulsanti */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-controls h2 {
    flex-grow: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    color: var(--black);
}

.calendar-controls h2 i {
    color: var(--primary-color);
}

/* Calendar Wrapper */
.calendar-wrapper {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.calendar-container {
    overflow-x: auto;
    position: relative;
}

/* Calendar Table Structure */
#calendar {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.calendar-row {
    display: table-row;
}

.calendar-cell {
    display: table-cell;
    border: 1px solid var(--grey-border);
    padding: 10px;
    vertical-align: top;
    min-width: 80px;
    height: 100px;
    position: relative;
    background: var(--white);
    transition: background var(--transition-speed);
}

/* Calendar Header - Days Row */
.calendar-header {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    text-align: center;
    padding: 15px 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Store Names Column - Sticky Left */
.store-name {
    background: var(--grey-light);
    font-weight: 700;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 150px;
    height: 100px;
    white-space: nowrap;
    box-shadow: 10px 0 5px var(--shadow);
    padding: 15px;
    vertical-align: middle;
    border-left: 5px solid;
}

/* Day Header Content */
.day-header {
    text-align: center;
    font-size: 12px;
}

.day-number {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.day-name {
    font-size: 11px;
    opacity: 0.8;
    display: block;
}

.holiday-desc {
    font-size: 9px;
    display: block;
    margin-top: 2px;
    font-style: italic;
    opacity: 0.9;
}

/* Special Days - Domeniche e Festività */
.sunday,
.holiday {
    background: var(--danger-color) !important;
    color: var(--white);
}

.sunday .shift-time,
.holiday .shift-time {
    color: var(--white) !important;
}

.sunday .shift-label,
.holiday .shift-label {
    border: 1px solid var(--white);
}

/* ========================================
   SHIFTS DISPLAY - Visualizzazione Turni
   ======================================== */

/* Container for Shifts in Cell - Griglia Fissa */
.shifts-container {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    margin-top: 5px;
    min-height: 55px;
}

/* Single Shift Item */
.shift-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Posizionamento Fisso Turni */
.shift-item[data-shift="Ma"] {
    grid-row: 1;
}

.shift-item[data-shift="Po"] {
    grid-row: 2;
}

.shift-item[data-shift="Se"] {
    grid-row: 3;
}

/* Shift Type Badge (Ma, Po, PP, Se) */
.shift-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    color: var(--white);
    font-size: 9px;
}

/* Shift Time Display */
.shift-time {
    color: var(--black);
    font-weight: 500;
    font-size: 11px;
    white-space: nowrap;
}

/* Shift Type Colors */
.shift-Ma {
    background: var(--shift-morning);
}

.shift-PP {
    background: var(--shift-lunch);
    color: #333;
}

.shift-Po {
    background: var(--shift-afternoon);
}

.shift-Se {
    background: var(--shift-evening);
}

/* Edit Mode - Clickable Cells */
.edit-mode .calendar-cell {
    cursor: pointer;
}

.edit-mode .calendar-cell:hover {
    background: #f0f0f0;
}

/* ========================================
   MODAL - Finestre Modali
   ======================================== */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
}

/* Modal Content Box */
.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow-dark);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header - Store Name and Date on Same Line */
.modal-content .modal-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-content .modal-header-inline h3 {
    margin: 0;
    color: var(--black);
    font-size: 20px;
}

.modal-content .modal-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

/* Modal Close Button */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--grey);
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-speed);
}

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

.modal-close:focus {
    outline: 2px solid var(--danger-color);
    border-radius: var(--border-radius-small);
}

/* Modal Body */
.modal-body {
    margin-bottom: 20px;
}

/* Shift Group - Each Shift Section */
.shift-group {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-small);
    background: #fafafa;
}

/* Shift Checkbox - Enable/Disable Shift */
.shift-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.shift-checkbox:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.shift-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.shift-checkbox label {
    font-weight: 600;
    flex-grow: 1;
    cursor: pointer;
}

/* Shift Controls - Time Inputs and Preset Buttons */
.modal-content .shift-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    margin-left: 32px;
}

/* Time Input Fields */
.modal-content .shift-times {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content .shift-times input[type="time"] {
    padding: 6px 10px;
    border: 1px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    font-size: 13px;
}

.modal-content .shift-times span {
    color: var(--grey);
    font-weight: 600;
}

/* Preset Buttons Inline */
.modal-content .preset-buttons-inline {
    display: flex;
    gap: 5px;
}

.btn-preset-small {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-speed);
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-preset-small:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.btn-preset-small:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Preset Button Colors */
.btn-preset-classico {
    background: var(--grey-dark);
    color: var(--white);
}

.btn-preset-festivo {
    background: var(--danger-color);
    color: var(--white);
}

.btn-preset-estivo {
    background: var(--warning-color);
    color: #000;
}

.btn-preset-serale {
    background: var(--shift-evening);
    color: var(--white);
}

/* Modal Footer - Action Buttons */
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   CONFIGURATION PAGE - Pagina Configurazione
   ======================================== */

.config-container {
    max-width: 1200px;
    margin: 0 auto;
}

.config-header {
    margin-bottom: 30px;
    text-align: center;
}

.config-header h1 {
    font-size: 28px;
    color: var(--black);
    margin-bottom: 10px;
}

.config-header h1 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.config-subtitle {
    color: var(--grey);
    font-size: 16px;
}

/* Configuration Tabs */
.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
}

.tab-button {
    padding: 15px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--grey);
    transition: all var(--transition-speed);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--grey-light);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ========================================
   STORES CONFIGURATION - Gestione Negozi
   ======================================== */

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.store-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 5px solid;
    transition: all var(--transition-speed);
    position: relative;
}

.store-card:hover {
    box-shadow: 0 4px 16px var(--shadow-dark);
    transform: translateY(-2px);
}

.store-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.store-card h3 {
    color: var(--black);
    font-size: 18px;
    margin: 0 0 5px 0;
}

.store-email {
    color: var(--grey);
    font-size: 13px;
    display: block;
    word-break: break-word;
}

.store-card-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: all var(--transition-speed);
    border-radius: var(--border-radius-small);
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon:focus {
    outline: 2px solid currentColor;
}

.btn-edit {
    color: var(--primary-color);
}

.btn-edit:hover {
    background: var(--primary-light);
}

.btn-delete {
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-light);
}

/* Store Status Toggle */
.store-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--grey-light);
    border-radius: var(--border-radius-small);
}

.status-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.status-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--grey-dark);
    transition: var(--transition-speed);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    transition: var(--transition-speed);
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: var(--success-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.status-label {
    font-size: 13px;
    font-weight: 600;
}

.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--danger-color);
}

/* Color Picker */
.color-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-small);
    border: 2px solid var(--grey-border);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.color-preview:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* ========================================
   EMAIL CONFIGURATION - Configurazione SMTP
   ======================================== */

.email-config-form {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
    max-width: 700px;
}

.email-config-form .form-group {
    margin-bottom: 25px;
}

.config-section {
    margin-bottom: 30px;
}

.config-section h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* ========================================
   SPECIAL DAYS CONFIGURATION - Festività
   ======================================== */

.special-days-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.year-selector button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.year-selector button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.year-selector button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.year-selector h3 {
    font-size: 24px;
    margin: 0;
    min-width: 100px;
    text-align: center;
    color: var(--black);
}

/* Special Days Grid */
.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.month-card {
    background: var(--white);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all var(--transition-speed);
}

.month-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.month-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.special-days-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.special-day-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--grey-light);
    border-radius: var(--border-radius-small);
    border-left: 3px solid var(--danger-color);
}

.special-day-date {
    font-weight: 600;
    color: var(--black);
    font-size: 14px;
}

.special-day-desc {
    color: var(--grey);
    font-size: 12px;
    flex-grow: 1;
    margin: 0 10px;
}

.btn-remove-day {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: all var(--transition-speed);
}

.btn-remove-day:hover {
    transform: scale(1.2);
    color: #c82333;
}

/* Add Special Day Form */
.add-special-day-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.add-special-day-form input[type="date"],
.add-special-day-form input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    font-size: 13px;
}

.btn-add-day {
    background: var(--success-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.btn-add-day:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* ========================================
   SEND EMAIL PAGE - Invio Email
   ======================================== */

.send-container {
    max-width: 1400px;
    margin: 0 auto;
}

.send-header {
    margin-bottom: 30px;
    text-align: center;
}

.send-header h1 {
    font-size: 28px;
    color: var(--black);
    margin-bottom: 10px;
}

.send-header h1 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.send-subtitle {
    color: var(--grey);
    font-size: 16px;
}

/* Test Section - Invio Automatico Test */
.test-section {
    background: var(--warning-light);
    border: 2px solid var(--warning-color);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    text-align: center;
}

.test-header h3 {
    color: #f57c00;
    margin-bottom: 10px;
    font-size: 20px;
}

.test-header h3 i {
    margin-right: 10px;
}

.test-header p {
    color: var(--grey);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Month Selector */
.month-selector {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.month-form {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group-inline label {
    font-weight: 600;
    color: var(--black);
}

.form-group-inline .form-select {
    padding: 10px 15px;
    border: 2px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    font-size: 14px;
    min-width: 150px;
}

/* Send Form */
.send-form {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.stores-section h3 {
    font-size: 20px;
    color: var(--black);
    margin-bottom: 10px;
}

.section-help {
    color: var(--grey);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Stores Grid - 2 Columns Layout */
.stores-grid-2cols {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

/* Store Card for Selection */
.store-card {
    background: var(--white);
    border: 2px solid var(--grey-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-speed);
}

.store-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow);
}

.store-label {
    display: block;
    cursor: pointer;
}

.store-checkbox {
    display: none;
}

.store-checkbox:checked + .store-info {
    background: var(--primary-light);
    border-left-color: var(--primary-color);
}

.store-info {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    border-left: 5px solid transparent;
    transition: all var(--transition-speed);
}

.store-color {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-small);
    flex-shrink: 0;
}

.store-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.store-name {
    font-weight: 700;
    color: var(--black);
    font-size: 16px;
}

.store-email {
    color: var(--grey);
    font-size: 13px;
}

.store-shifts {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
}

/* Send Actions Buttons */
.send-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Logs Section - Email History */
.logs-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
    margin-top: 40px;
}

.logs-section h3 {
    font-size: 20px;
    color: var(--black);
    margin-bottom: 20px;
}

.logs-section h3 i {
    color: var(--primary-color);
    margin-right: 10px;
}

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

.logs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.logs-table thead {
    background: var(--grey-light);
}

.logs-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--black);
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    white-space: nowrap;
}

.logs-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.logs-table tbody tr:hover {
    background: var(--grey-light);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-success {
    background: var(--success-light);
    color: #155724;
}

.status-failed {
    background: var(--danger-light);
    color: #721c24;
    cursor: help;
}

/* ========================================
   ACTIVITY LOGS PAGE - Log Attività
   ======================================== */

.logs-container {
    max-width: 1400px;
    margin: 0 auto;
}

.logs-header {
    margin-bottom: 30px;
    text-align: center;
}

.logs-header h1 {
    font-size: 28px;
    color: var(--black);
    margin-bottom: 10px;
}

.logs-header h1 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.logs-subtitle {
    color: var(--grey);
    font-size: 16px;
}

/* Filters Section */
.logs-filters {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: var(--black);
    font-size: 13px;
}

.filter-group .form-select,
.filter-group .form-control {
    padding: 8px 12px;
    border: 2px solid var(--grey-border);
    border-radius: var(--border-radius-small);
    font-size: 14px;
    min-width: 150px;
    transition: all var(--transition-speed);
}

.filter-group .form-select:focus,
.filter-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-group .form-control[type="date"] {
    min-width: 140px;
}

/* Action Badges in Logs */
.action-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius-small);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.action-login {
    background: var(--success-light);
    color: #155724;
}

.action-logout {
    background: var(--danger-light);
    color: #721c24;
}

.action-create {
    background: var(--info-light);
    color: #0c5460;
}

.action-update {
    background: var(--warning-light);
    color: #856404;
}

.action-delete {
    background: var(--danger-light);
    color: #721c24;
}

/* Details Button */
.btn-details {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-speed);
}

.btn-details:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-details:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modal Details Styles */
.details-section {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--grey-light);
    border-radius: var(--border-radius);
}

.details-section h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--black);
    min-width: 120px;
}

.detail-value {
    color: var(--grey);
    flex: 1;
}

.value-box {
    background: var(--white);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius-small);
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    max-height: 300px;
    margin: 0;
    color: var(--black);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--white);
    padding: 20px;
    text-align: center;
    box-shadow: 0 -2px 10px var(--shadow);
    margin-top: 40px;
}

footer p {
    color: var(--grey);
    font-size: 14px;
    margin: 0;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile & Tablet
   ======================================== */

/* Tablet - max-width: 1024px */
@media (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }

    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .months-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .stores-grid-2cols {
        grid-template-columns: 1fr;
    }
}

/* Mobile Large - max-width: 768px */
@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
        --sidebar-width: 280px;
    }

    /* Navbar Mobile */
    .navbar {
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .nav-left,
    .nav-right {
        flex: none;
    }

    .nav-center {
        flex: 1;
        order: 3;
        width: 100%;
        margin-top: 10px;
    }

    .nav-title {
        font-size: 16px;
    }

    .user-name {
        display: none;
    }

    .user-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .logo {
        height: 35px;
    }

    /* Main Content Mobile */
    .main-content {
        padding: 15px;
    }

    /* Calendar Mobile */
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
    }

    .calendar-controls h2 {
        font-size: 20px;
    }

    .calendar-controls .btn {
        width: 100%;
    }

    .calendar-wrapper {
        padding: 10px;
    }

    .calendar-cell {
        min-width: 70px;
        padding: 8px;
        font-size: 11px;
    }

    .store-name {
        min-width: 120px;
        font-size: 13px;
        padding: 10px;
    }

    .day-header {
        font-size: 11px;
    }

    .day-number {
        font-size: 16px;
    }

    .shift-label {
        font-size: 8px;
        padding: 2px 4px;
    }

    .shift-time {
        font-size: 10px;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }

    .modal-content .modal-header-inline h3 {
        font-size: 18px;
    }

    .modal-content .shift-controls {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
    }

    .modal-content .shift-times {
        width: 100%;
    }

    .modal-content .shift-times input[type="time"] {
        flex: 1;
    }

    .modal-content .preset-buttons-inline {
        width: 100%;
        justify-content: space-between;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Configuration Mobile */
    .config-tabs {
        gap: 5px;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 13px;
    }

    .stores-grid {
        grid-template-columns: 1fr;
    }

    .months-grid {
        grid-template-columns: 1fr;
    }

    .email-config-form {
        padding: 20px;
    }

    /* Send Email Mobile */
    .send-container {
        padding: 0 15px;
    }

    .test-section {
        padding: 20px 15px;
    }

    .test-header h3 {
        font-size: 18px;
    }

    .test-header p {
        font-size: 13px;
    }

    .month-selector {
        padding: 15px;
    }

    .form-group-inline {
        flex-direction: column;
        width: 100%;
    }

    .form-group-inline .form-select {
        width: 100%;
    }

    .send-form {
        padding: 20px 15px;
    }

    .stores-grid-2cols {
        grid-template-columns: 1fr;
    }

    .send-actions {
        flex-direction: column;
    }

    .send-actions .btn {
        width: 100%;
    }

    /* Logs Mobile */
    .logs-container {
        padding: 0 15px;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group .form-select,
    .filter-group .form-control {
        min-width: 100%;
    }

    .logs-filters {
        padding: 15px;
    }

    .logs-table-wrapper {
        padding: 10px;
    }

    .logs-table {
        font-size: 11px;
    }

    .logs-table th,
    .logs-table td {
        padding: 8px 5px;
    }

    .logs-header h1 {
        font-size: 22px;
    }

    /* Detail Modal Mobile */
    .detail-item {
        flex-direction: column;
        gap: 5px;
    }

    .detail-label {
        min-width: auto;
        font-size: 13px;
    }

    .value-box {
        font-size: 11px;
        padding: 10px;
    }

    /* Buttons Mobile */
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .btn-large {
        padding: 14px 30px;
        font-size: 14px;
        min-width: 200px;
    }
}

/* Mobile Small - max-width: 480px */
@media (max-width: 480px) {
    .navbar {
        padding: 8px 10px;
    }

    .nav-title {
        font-size: 14px;
    }

    .logo {
        height: 30px;
    }

    .calendar-controls h2 {
        font-size: 18px;
    }

    .store-name {
        min-width: 100px;
        font-size: 12px;
    }

    .calendar-cell {
        min-width: 60px;
        padding: 5px;
    }

    .day-number {
        font-size: 14px;
    }

    .modal-content {
        padding: 15px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .btn-large {
        min-width: 150px;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --white: #1a1a1a;
        --black: #f0f0f0;
        --grey-light: #2d2d2d;
        --grey-border: #404040;
        --shadow: rgba(0, 0, 0, 0.3);
    }

    body {
        background: #1a1a1a;
        color: #f0f0f0;
    }

    .navbar,
    .calendar-wrapper,
    .modal-content,
    .config-tabs,
    .send-form,
    .logs-filters {
        background: #2d2d2d;
    }

    .calendar-cell,
    .store-card,
    .month-card {
        background: #2d2d2d;
        border-color: #404040;
    }

    .form-control,
    .form-select {
        background: #2d2d2d;
        color: #f0f0f0;
        border-color: #404040;
    }
    */
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .navbar,
    .sidebar,
    .sidebar-overlay,
    .calendar-controls,
    .btn,
    .modal,
    footer {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .calendar-wrapper {
        box-shadow: none;
    }

    .calendar-cell {
        page-break-inside: avoid;
    }

    body {
        background: white;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .calendar-cell {
        border-width: 2px;
    }

    .shift-label {
        border: 1px solid var(--white);
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Spacing Utilities */
.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

/* Display Utilities */
.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Width Utilities */
.w-100 {
    width: 100%;
}

.w-50 {
    width: 50%;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

.spin {
    animation: spin 1s linear infinite;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

/* ========================================
   END OF STYLESHEET
   ======================================== */