/* C:\xampp\htdocs\gruppo-arancio\assets\css\style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors from Logo */
    --primary: #C69D72;
    --primary-light: #D9B98C;
    --primary-hover: #b58a5f;
    --primary-subtle: rgba(198, 157, 114, 0.08);
    --primary-glow: rgba(198, 157, 114, 0.15);

    /* Neutrals */
    --white: #FFFFFF;
    --bg: #FAFAFA;
    --bg-warm: #FDF9F5;
    --surface: #FFFFFF;
    --border: #EBEBEB;
    --border-light: #F3F3F3;
    --text: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-muted: #9CA3AF;

    /* Status */
    --status-red: #EF4444;
    --status-green: #10B981;
    --status-blue: #3B82F6;
    --status-amber: #F59E0B;

    /* Fonts */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-hover);
}

/* ===== LAYOUT ===== */
.container {
    width: 92%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Pages (Login / Register) */
.bg-beige-light {
    background: var(--bg-warm);
}

.auth-container {
    max-width: 380px;
    margin: 60px auto;
    background: var(--white);
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border-light);
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    width: 200px;
    height: auto;
    border-radius: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 17px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-nav .nav-link:hover,
.sidebar-footer .nav-link:hover {
    background: var(--primary-subtle);
    color: var(--text);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-icon-svg {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
    stroke: currentColor;
}

.nav-badge {
    background: var(--status-red);
    color: white;
    font-size: 14px;
    padding: 2px 9px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border-light);
}

.nav-link-logout {
    color: var(--status-red) !important;
}

.nav-link-logout:hover {
    background: rgba(239, 68, 68, 0.06) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    min-height: 100vh;
    background: var(--bg);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.sidebar-toggle svg {
    pointer-events: none;
}

/* ===== HEADER ===== */
header {
    background: var(--white);
    padding: 14px 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-main {
    max-height: 40px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 17px;
    font-family: var(--font);
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 17px;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-family: var(--font);
    font-size: 17px;
    color: var(--text);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2.3rem;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===== TABLES ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg);
    color: var(--text-secondary);
    text-align: left;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: 17px;
    vertical-align: middle;
}

tr:hover {
    background: var(--primary-subtle);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-red);
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-green);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-blue);
}

.badge-gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ===== GRID ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.col-65 {
    width: calc(65% - 8px);
}

.col-35 {
    width: calc(35% - 8px);
}

.col-100 {
    width: 100%;
}

/* ===== STAT CARDS (Admin Dashboard) ===== */
.stat-cards-wrapper {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 16px;
    overflow-x: auto;
}
.stat-card-custom {
    background: var(--bg-warm);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stat-card-custom.card-1 { border-left: 4px solid var(--primary); }
.stat-card-custom.card-2 { border-left: 4px solid var(--primary-light); }
.stat-card-custom.card-3 { border-left: 4px solid var(--primary-hover); }
.stat-card-custom .stat-num { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 6px; }
.stat-card-custom .stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    animation: toastIn 0.35s ease, toastOut 0.35s ease 3.65s forwards;
    max-width: 380px;
    pointer-events: auto;
}
.toast-success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.toast-error {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* Row 2: Social Links (Left) and History (Right) */
.dashboard-grid-row2 {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .dashboard-grid-row2 {
        flex-direction: column-reverse; /* History first on mobile */
    }
}

/* Social Cards */
.social-card {
    border-bottom: 1px solid var(--border-light);
    padding: 15px 0;
}
.social-card:last-child { border-bottom: none; }
.social-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.social-logo-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #f9f9f9;
}
.social-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.social-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: var(--text-secondary);
    padding: 8px 13px;
    border-radius: 6px;
    background: var(--bg-warm);
    transition: var(--transition);
}
.social-link-item:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* Toggle Switch (Minimal) */
.slot-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 6px;
}
.toggle-btn {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background-color 0.25s ease;
    background-color: #E0E0E0;
    padding: 0;
    flex-shrink: 0;
}
.toggle-btn.attivo {
    background-color: #27AE60;
}
.toggle-btn.disattivato {
    background-color: #E74C3C;
}
.toggle-btn.locked {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.toggle-pill {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-btn.attivo .toggle-pill {
    transform: translateX(18px);
}

/* Accordion for Social */
.social-accordion-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.social-accordion-content {
    display: none;
    margin-top: 15px;
}
.social-accordion.open .social-accordion-content {
    display: block;
}
.accordion-arrow {
    transition: transform 0.3s ease;
    font-size: 14px;
    color: var(--text-muted);
}
.social-accordion.open .accordion-arrow {
    transform: rotate(-180deg);
}


/* ===== ALERTS ===== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 17px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

/* ===== RESTAURANT SELECTOR ===== */
.restaurant-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.restaurant-card {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.restaurant-card.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.restaurant-logo {
    max-width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 600;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== SECTION TITLE (forms) ===== */
.section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
    margin: 36px 0 20px;
    padding-bottom: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 60px;
    }
}

@media (max-width: 1024px) {

    .col-65,
    .col-35,
    .col-33 {
        width: 100% !important;
    }

    .row {
        flex-direction: column;
        gap: 12px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .auth-container {
        margin: 30px auto;
        width: calc(100% - 32px);
        padding: 28px 22px;
    }

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

    td,
    th {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .main-content {
        overflow-x: hidden;
    }

    .card {
        overflow: hidden;
    }

    /* Stat cards responsive */
    .stat-cards-wrapper { gap: 8px; }
    .stat-card-custom { padding: 12px 4px; }
    .stat-card-custom .stat-num { font-size: 20px; }
    .stat-card-custom .stat-label { 
        font-size: 9px; 
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; 
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 14px;
        padding-top: 56px;
    }

    .restaurant-selector {
        flex-direction: column;
    }

    .card {
        padding: 16px;
    }

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

/* ===== FOOTER ===== */
.footer {
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    background: transparent;
    margin-top: 20px;
}

.footer-admin {
    margin-top: 20px;
    padding: 15px 0;
    color: var(--text-muted);
    font-size: 10px;
    text-align: center;
    background: transparent;
}

@media (max-width: 768px) {
    .footer {
        padding: 15px 14px;
        margin-top: 15px;
    }
}

/* ===== PARTNER SIDE OVERRIDES (DIMENSIONI INIZIALI) ===== */
body.partner-side { font-size: 14px; }
body.partner-side .btn { font-size: 13px; padding: 10px 20px; }
body.partner-side label { font-size: 13px; margin-bottom: 6px; }
body.partner-side input[type="text"],
body.partner-side input[type="password"],
body.partner-side input[type="email"],
body.partner-side input[type="number"],
body.partner-side input[type="date"],
body.partner-side input[type="file"],
body.partner-side select,
body.partner-side textarea { font-size: 13px; padding: 10px 12px; }
body.partner-side .card-title { font-size: 15px; margin-bottom: 20px; padding-bottom: 12px; }
body.partner-side th { font-size: 11px; padding: 10px 14px; }
body.partner-side td { font-size: 13px; padding: 12px 14px; }
body.partner-side .badge { font-size: 11px; padding: 3px 10px; }
body.partner-side .social-link-item { font-size: 13px; padding: 6px 10px; }
body.partner-side .alert { font-size: 13px; padding: 12px 16px; }
body.partner-side .page-header h2 { font-size: 20px; }
body.partner-side .page-subtitle { font-size: 12px; }
body.partner-side .section-title { font-size: 13px; margin: 28px 0 16px; padding-bottom: 8px; }