/* ═══════════════════════════════════════════════════════════════
   workers.css — WilyWorkers Centralized Stylesheet
   Theme : Blanc + Bleu Ciel (#0EA5E9)
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --sky: #0EA5E9;
    --sky-dark: #0284c7;
    --sky-light: #e0f2fe;
    --sky-bg: #f0f9ff;
    --gold: #FFC107;
    --gold-bg: #fffbeb;
    --green: #22c55e;
    --green-bg: #f0fdf4;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --orange: #f59e0b;
    --orange-bg: #fffbeb;
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;

    --bg: #ffffff;
    --card: #f8fafc;
    --card-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-lt: #f1f5f9;
    --muted: #64748b;
    --muted-lt: #94a3b8;
    --text: #0f172a;
    --text-lt: #475569;
    --navy: #0f172a;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --font: 'Poppins', sans-serif;
    --font-serif: 'Lora', serif;
}

/* ── Reset & Body ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── HEADER (Page Header bleu ciel) ── */
.page-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--sky) 0%, var(--sky-dark) 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header.dash-header {
    padding: 20px;
    border-radius: 0 0 24px 24px;
}

.page-back {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: 0.2s;
}

.page-back:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.25);
}

.page-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
    font-family: var(--font-serif);
}

.page-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* ── Section titles ── */
.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 2px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-head .section-title {
    margin-bottom: 0;
}

/* ── Cards / Panels ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 15px;
    line-height: 1.4;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-val {
    font-size: 24px;
    font-weight: 800;
}

.stat-val.accent {
    color: var(--gold);
}

.stat-label {
    font-size: 9px;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── BADGES / Pills ── */
.badge-pill {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

.badge-sky {
    background: var(--sky-light);
    color: var(--sky-dark);
}

.badge-gold {
    background: var(--gold-bg);
    color: #b45309;
}

.badge-green {
    background: var(--green-bg);
    color: #16a34a;
}

.badge-red {
    background: var(--red-bg);
    color: #dc2626;
}

.badge-gray {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: 0.2s;
}

.form-input:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input::placeholder {
    color: var(--muted-lt);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

textarea.form-input {
    resize: none;
    height: 80px;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.toggle-sub {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--sky);
}

.toggle-switch::after {
    content: '';
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
    box-shadow: var(--shadow);
}

.toggle-switch.active::after {
    left: 24px;
}

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--sky);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.15s;
    text-decoration: none;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.15s;
}

.btn-secondary:active {
    background: var(--card-hover);
}

.btn-danger {
    background: var(--red);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.15s;
}

.btn-danger:active {
    transform: scale(0.98);
}

/* ── BOTTOM NAVBAR ── */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: var(--muted-lt);
    font-size: 22px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: 0.2s;
}

.nav-item.active {
    color: var(--sky);
}

.nav-item span {
    font-size: 9px;
    font-weight: 600;
}

.nav-item .nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--sky);
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
}

/* ── HEADER (non-sticky, simple) ── */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.header-bar .page-title {
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 20px;
}

/* ── MODAL DEFAULTS ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-drawer {
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    border-radius: 24px 24px 0 0;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-serif);
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card);
    border: none;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── ALERTS / MESSAGES ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.alert.success {
    background: var(--green-bg);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert.error {
    background: var(--red-bg);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.warning {
    background: var(--orange-bg);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert.info {
    background: var(--sky-bg);
    color: var(--sky-dark);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ── MENU GRID (2 columns) ── */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.menu-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 14px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    transition: 0.15s;
    cursor: pointer;
    color: var(--text);
}

.menu-card:active {
    transform: scale(0.96);
    background: var(--card-hover);
}

.menu-card.wide {
    grid-column: 1 / -1;
    flex-direction: row;
    text-align: left;
    justify-content: flex-start;
    padding: 15px 18px;
    gap: 14px;
    border-radius: var(--radius);
}

.menu-card.accent-sky {
    border-color: rgba(14, 165, 233, 0.3);
    background: var(--sky-bg);
}

.menu-card.accent-gold {
    border-color: rgba(255, 193, 7, 0.3);
    background: var(--gold-bg);
}

.mc-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.menu-card.wide .mc-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 11px;
}

.ic-sky {
    background: var(--sky-bg);
    color: var(--sky);
}

.ic-gold {
    background: var(--gold-bg);
    color: #d97706;
}

.ic-green {
    background: var(--green-bg);
    color: var(--green);
}

.ic-purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.ic-gray {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}

.ic-red {
    background: var(--red-bg);
    color: var(--red);
}

/* ── Stats Grid (3 cols) ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 20px;
}

/* ── Actions Row ── */
.actions-row {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.action-btn {
    flex: 1;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text);
}

.action-btn:active {
    transform: scale(0.96);
    background: var(--sky-bg);
    border-color: var(--sky);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.action-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

.empty-state ion-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-state-sub {
    font-size: 12px;
    color: var(--muted-lt);
}

/* ── Info Box ── */
.info-box {
    background: var(--sky-bg);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 12px;
    color: var(--sky-dark);
    line-height: 1.6;
}

.info-box strong {
    color: var(--sky);
    display: block;
    margin-bottom: 4px;
}

/* ── Revenue Card ── */
.revenue-card {
    background: var(--green-bg);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius);
    padding: 16px;
}

.revenue-title {
    font-size: 14px;
    font-weight: 700;
    color: #16a34a;
}

/* ── Plan Card ── */
.plan-card-dash {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.plan-card-dash.free {
    border-color: var(--border);
}

.plan-card-dash.pro {
    border-color: rgba(212, 175, 55, 0.3);
    background: var(--gold-bg);
}

.plan-name-dash {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-badge-dash {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.plan-badge-dash.free {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}

.plan-badge-dash.pro {
    background: var(--gold-bg);
    color: #b45309;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ── Chat Card ── */
.chat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.15s;
    border: 1px solid var(--border);
}

.chat-card:active {
    background: var(--sky-bg);
}

.chat-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--border);
}

.chat-card-name {
    font-weight: 700;
    font-size: 13px;
}

.chat-card-msg {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.chat-card-time {
    font-size: 9px;
    color: var(--muted-lt);
}

.chat-card-unread {
    background: var(--sky);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

/* ── SOLDE CARD (blue gradient) ── */
.solde-card {
    background: linear-gradient(135deg, var(--sky) 0%, var(--sky-dark) 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.solde-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.solde-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.solde-montant {
    font-size: 32px;
    font-weight: 800;
    margin-top: 6px;
}

/* ── Dashboard Header ── */
.dash-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--sky) 0%, var(--sky-dark) 100%);
    border-radius: 0 0 24px 24px;
    color: white;
}

.dash-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-brand {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-serif);
}

.dash-brand span {
    color: var(--gold);
}

.dash-notif {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-notif .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.dash-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.dash-hello {
    font-size: 12px;
    opacity: 0.7;
}

.dash-name {
    font-size: 18px;
    font-weight: 800;
}

.dash-badges {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

/* ── Worker Online Status ── */
.worker-online-status {
    background: var(--green-bg);
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.worker-online-status.offline {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}

.worker-online-status .pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    animation: pulse-green 2s infinite;
}

.worker-online-status.offline .pulse-indicator {
    background: var(--muted-lt);
    animation: none;
    box-shadow: none;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
}

/* ── Section Padding ── */
.section {
    padding: 0 20px;
    margin-bottom: 20px;
}

/* ── PRO BANNER ── */
.pro-banner {
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin: 0 20px 20px;
}

.pro-banner:active {
    transform: scale(0.98);
}

.pro-banner-title {
    font-weight: 800;
    font-size: 14px;
    color: #000;
}

.pro-banner-sub {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.6);
}

.pro-banner-price {
    font-weight: 800;
    font-size: 16px;
    color: #000;
    margin-left: auto;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px 16px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-val {
        font-size: 20px;
    }
}