:root {
    --bg-start: #050505;
    --bg-end: #0b0b0b;
    --text-main: #ffffff;
    --text-soft: #d8d8d8;
    --text-muted: #b8b8b8;
    --text-dim: #8f8f8f;
    --green: #57ff9c;
    --green-dark: #20d96b;
    --green-border: rgba(57, 255, 136, 0.18);
    --green-border-strong: rgba(57, 255, 136, 0.30);
    --green-glow: rgba(57, 255, 136, 0.20);
    --red: #ff6b6b;
    --red-dark: #e53935;
    --blue: #7dd3fc;
    --blue-dark: #38bdf8;
    --orange: #f97316;
    --orange-dark: #ea580c;
    --yellow: #facc15;
    --yellow-dark: #eab308;
    --panel-bg: linear-gradient(180deg, rgba(12, 12, 12, 0.95), rgba(7, 7, 7, 0.96));
    --panel-bg-strong: linear-gradient(180deg, rgba(12, 12, 12, 0.95), rgba(5, 5, 5, 0.98));
    --panel-shadow:
        0 0 20px rgba(57, 255, 136, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    --panel-radius: 24px;
    --radius-pill: 999px;
    --transition-fast: 0.25s ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(57, 255, 136, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(57, 255, 136, 0.10), transparent 30%),
        linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

img,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

.container,
.hero-box,
.table-box,
.scan-panel,
.scan-side-card,
.card,
.login-box,
form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

input,
select,
textarea,
button {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: #33E67C;
}

/* =========================
   TOPBAR / NAVIGATION
   ========================= */

.topbar {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(57, 255, 136, 0.20);
    box-shadow: 0 0 20px rgba(57, 255, 136, 0.08);
}

.topbar-inner {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.topbar h1 {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--green);
    text-shadow:
        0 0 10px rgba(57, 255, 136, 0.18),
        0 0 24px rgba(57, 255, 136, 0.10);
}

.topbar nav,
.topbar .desktop-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar nav a,
.topbar .desktop-nav a,
.topbar .mobile-menu a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--green-border);
    background: rgba(57, 255, 136, 0.08);
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition-fast);
}

.topbar nav a:hover,
.topbar .desktop-nav a:hover,
.topbar .mobile-menu a:hover {
    background: rgba(57, 255, 136, 0.18);
    box-shadow: 0 0 12px rgba(57, 255, 136, 0.25);
    transform: translateY(-1px);
}

.topbar .mobile-menu {
    display: none !important;
}

.burger-btn {
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(57, 255, 136, 0.22);
    border-radius: 14px;
    background: rgba(57, 255, 136, 0.08);
    box-shadow: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.burger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--text-main);
    transition: var(--transition-fast);
}

.burger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.open span:nth-child(2) {
    opacity: 0;
}

.burger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   LAYOUT / PANELS / TYPO
   ========================= */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 20px;
    overflow-x: hidden;
}

.hero-box,
form,
.table-box,
.card,
.login-box,
.scan-panel,
.scan-side-card,
.chart-card {
    border: 1px solid var(--green-border);
    border-radius: var(--panel-radius);
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
}

.hero-box {
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    padding: 30px 24px;
    border-color: rgba(57, 255, 136, 0.25);
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.94), rgba(4, 4, 4, 0.96));
    box-shadow:
        0 0 0 1px rgba(57, 255, 136, 0.08) inset,
        0 0 30px rgba(57, 255, 136, 0.10),
        0 0 80px rgba(57, 255, 136, 0.05);
}

.hero-box::before,
.scan-panel::before,
.scan-side-card::before {
    content: "";
    position: absolute;
    pointer-events: none;
    background: radial-gradient(circle, rgba(57, 255, 136, 0.16), transparent 68%);
}

.hero-box::before {
    inset: -40% auto auto -20%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(57, 255, 136, 0.20), transparent 65%);
}

.hero-label,
.scan-badge,
.scan-mini-label,
.badge-top-label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 9px 14px;
    border-radius: 14px;
    border: 1px solid rgba(57, 255, 136, 0.25);
    background: rgba(57, 255, 136, 0.10);
    color: var(--text-main);
    font-weight: bold;
}

.hero-label {
    margin-bottom: 18px;
    padding: 10px 18px;
    font-size: 18px;
    border-color: var(--green-border-strong);
    background: rgba(57, 255, 136, 0.14);
    box-shadow: 0 0 20px rgba(57, 255, 136, 0.12);
}

.hero-title,
.scan-title,
.page-title {
    margin: 0 0 20px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 40px;
    line-height: 1.1;
    color: var(--text-main);
}

.scan-title {
    font-size: 34px;
    line-height: 1.1;
    color: var(--text-main);
}

.page-title {
    margin-bottom: 8px;
    font-size: 32px;
    color: var(--green);
    text-shadow: 0 0 14px rgba(57, 255, 136, 0.18);
}

.hero-subtitle,
.page-subtitle,
.scan-text {
    color: var(--text-muted);
}

.hero-subtitle {
    margin-bottom: 25px;
    font-size: 18px;
}

.page-subtitle {
    margin-bottom: 20px;
}

.scan-text {
    margin-bottom: 22px;
    font-size: 16px;
}

.cta-button,
button,
.action-link,
a.action-link,
.book-page-actions a,
.book-detail-actions a,
.workshop-detail-actions a,
.history-actions a,
.badge-actions a,
.filter-actions a {
    transition: var(--transition-fast);
}

.cta-button {
    display: inline-block;
    padding: 16px 28px;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
    color: #08140d;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    box-shadow:
        0 0 18px rgba(57, 255, 136, 0.35),
        0 10px 25px rgba(32, 217, 107, 0.18);
}

.cta-button:hover,
button:hover,
.action-link:hover,
a.action-link:hover,
a.edit-link:hover,
a.delete-link:hover {
    transform: translateY(-1px);
}

.cta-button:hover {
    transform: translateY(-2px) scale(1.01);
}

/* =========================
   FORMS
   ========================= */

form,
.login-box {
    padding: 22px;
    margin-bottom: 30px;
}

form {
    display: grid;
    gap: 16px;
}

.scan-form {
    gap: 14px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 3px;
    margin-left: 10px;
    color: var(--text-soft);
    font-weight: bold;
    line-height: 1.4;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(57, 255, 136, 0.16);
    border-radius: 14px;
    outline: none;
    background: #080808;
    color: #37E97F;
    font-size: 20px;
}
.checkbox-inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 10px;
    margin-left: 10px;
    cursor: pointer;
}

.checkbox-inline span {
    color: var(--text-soft);
    font-weight: bold;
    line-height: 1.2;
}

/* checkbox personnalisée */
.checkbox-inline input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    flex: 0 0 24px;
    margin: 0;
    padding: 0;
    border: 1px solid #37E97F;
    border-radius: 5px;
    background: #000000;
    box-shadow: none;
    position: relative;
    cursor: pointer;
}

/* coche verte */
.checkbox-inline input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #37E97F;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}
select,
select option {
    background: #000000;
    color: #37E97F;
}
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(57, 255, 136, 0.50);
    box-shadow: 0 0 0 3px rgba(57, 255, 136, 0.10);
}

button {
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
    color: #07110b;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(57, 255, 136, 0.25);
}

.login-box form,
form.login-box {
    gap: 8px !important;
}

.login-box label,
form.login-box label {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

.login-box input,
form.login-box input {
    margin-top: 0 !important;
}

.workshop-form,
.child-form {
    gap: 16px;
}

/* =========================
   TABLES / ALERTS / CARDS
   ========================= */

.table-box,
.card {
    padding: 22px;
}

.card {
    text-align: center;
    border-radius: 26px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 36px;
    color: var(--green);
    text-shadow: 0 0 14px rgba(57, 255, 136, 0.18);
}

.card p {
    margin: 0;
    font-size: 16px;
    color: #c7c7c7;
}

table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    border-radius: 18px;
}

table th,
table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(57, 255, 136, 0.10);
}

table th {
    background: rgba(57, 255, 136, 0.08);
    color: var(--text-main);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

table td {
    background: rgba(255, 255, 255, 0.01);
    color: #d5d5d5;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: bold;
}

.success {
    border: 1px solid var(--green-border-strong);
    background: rgba(57, 255, 136, 0.12);
    color: #aaffc8;
}

.error {
    border: 1px solid rgba(255, 80, 80, 0.25);
    background: rgba(255, 80, 80, 0.10);
    color: #ffb3b3;
}

/* =========================
   FILTERS / STATUS / ACTIONS
   ========================= */

.filter-form {
    margin-top: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 18px;
    align-items: end;
}

.attendance-filter-grid {
    grid-template-columns: 1.2fr 1.2fr 0.8fr 0.9fr auto;
}

.dashboard-date-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: end;
}

.filter-actions,
.camera-actions,
.badge-actions,
.book-page-actions,
.book-detail-actions,
.workshop-detail-actions,
.history-actions,
.mobile-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge-actions {
    justify-content: center;
    gap: 14px;
}

.mobile-action-stack {
    gap: 8px;
}

.status-pill,
.last-status-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: bold;
}

.last-status-badge {
    margin-top: 2px;
    padding: 10px 16px;
    font-size: 15px;
}

.status-active,
.last-status-checkin {
    border: 1px solid var(--green-border-strong);
    background: rgba(57, 255, 136, 0.14);
    color: #aaffc8;
}

.status-inactive,
.last-status-checkout {
    border: 1px solid rgba(255, 80, 80, 0.28);
    background: rgba(255, 80, 80, 0.12);
    color: #ffb8b8;
}

.status-neutral,
.last-status-none {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: #d6d6d6;
}

.action-link,
a.action-link,
a.action-link:link,
a.action-link:visited,
a.action-link:hover,
a.action-link:focus,
a.action-link:active {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: bold;
    color: #07110b;
}

.edit-link,
a.edit-link,
a.edit-link:link,
a.edit-link:visited,
a.edit-link:hover,
a.edit-link:focus,
a.edit-link:active {
    border: 1px solid rgba(57, 255, 136, 0.35);
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%) !important;
    color: #07110b !important;
    box-shadow: 0 0 18px rgba(57, 255, 136, 0.20);
}

.delete-link,
a.delete-link,
a.delete-link:link,
a.delete-link:visited,
a.delete-link:hover,
a.delete-link:focus,
a.delete-link:active {
    border: 1px solid rgba(255, 80, 80, 0.35);
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 18px rgba(255, 80, 80, 0.18);
}

.edit-link:active,
.delete-link:active,
a.edit-link:active,
a.delete-link:active {
    transform: scale(0.98);
}

.phone-green,
.phone-green a,
.phone-green a:link,
.phone-green a:visited,
.phone-green a:hover,
.phone-green a:active {
    color: var(--green) !important;
    font-weight: bold;
    text-decoration: none !important;
}

/* =========================
   SCAN
   ========================= */

.scan-hero {
    margin-bottom: 24px;
}

.scan-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 22px;
    align-items: start;
}

.scan-panel,
.scan-side-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    background: var(--panel-bg-strong);
}

.scan-panel::before,
.scan-side-card::before {
    top: -80px;
    left: -60px;
    width: 220px;
    height: 220px;
}

.action-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.action-card {
    display: block;
    cursor: pointer;
}

.action-card input {
    display: none;
}

.action-card-ui {
    display: block;
    min-height: 92px;
    padding: 18px 16px;
    border: 1px solid rgba(57, 255, 136, 0.16);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
}

.action-card input:checked + .action-card-ui {
    border-color: rgba(57, 255, 136, 0.55);
    background: linear-gradient(180deg, rgba(57, 255, 136, 0.10), rgba(57, 255, 136, 0.04));
    box-shadow:
        0 0 20px rgba(57, 255, 136, 0.16),
        inset 0 0 0 1px rgba(57, 255, 136, 0.22);
}

.action-big {
    display: block;
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--green);
}

.action-small {
    display: block;
    font-size: 14px;
    color: #d0d0d0;
}

.scan-submit-btn {
    margin-top: 8px;
    min-height: 56px;
    font-size: 18px;
}

.scan-side-inner h3 {
    margin: 0 0 14px;
    font-size: 28px;
    text-transform: uppercase;
}

.scan-steps {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.scan-steps li {
    padding: 12px 14px;
    border: 1px solid rgba(57, 255, 136, 0.10);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
}

.scan-status-box,
.last-status-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(57, 255, 136, 0.14);
    border-radius: 18px;
    background: rgba(57, 255, 136, 0.06);
}

.scan-status-box {
    text-align: center;
    color: #dfffe9;
    font-weight: bold;
}

.last-status-card {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.last-status-label {
    margin-bottom: 6px;
    color: #9f9f9f;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.last-status-value,
.last-status-time {
    color: var(--text-main);
    font-weight: bold;
}

.last-status-value {
    font-size: 20px;
}

.last-status-time {
    font-size: 18px;
}

.last-status-note {
    margin-top: 14px;
    color: #cfcfcf;
    line-height: 1.5;
}

.reader-box {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 360px;
    padding: 12px;
    border: 2px solid rgba(57, 255, 136, 0.30);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.reader-box::before {
    content: "Place le QR code dans le cadre";
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.65);
    color: var(--green);
    font-size: 14px;
    font-weight: bold;
}

.reader-box video {
    width: 100% !important;
    height: auto !important;
    border-radius: 16px;
    object-fit: cover;
}

.reader-box canvas {
    max-width: 100% !important;
    border-radius: 16px;
}

#startScanBtn {
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
    color: #07110b;
}

#stopScanBtn {
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--text-main);
}

/* =========================
   BADGES
   ========================= */

.badge-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.badge-card-print {
    width: 100%;
    max-width: 480px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid rgba(57, 255, 136, 0.22);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.96), rgba(5, 5, 5, 0.98));
    box-shadow:
        0 0 24px rgba(57, 255, 136, 0.10),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.badge-name {
    margin: 0 0 12px;
    font-size: 30px;
    text-transform: uppercase;
    color: var(--text-main);
}

.badge-info {
    margin-bottom: 18px;
    color: var(--text-soft);
}

.badge-qr-wrapper,
.screen-qr-wrapper {
    width: fit-content;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: #ffffff !important;
}

.badge-qr-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.screen-qr-wrapper {
    padding: 28px !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.screen-qr-wrapper #qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-qr-wrapper img,
.screen-qr-wrapper canvas {
    display: block;
    width: 320px !important;
    height: 320px !important;
    background: #ffffff;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.badge-code-text {
    margin: 8px 0 10px;
    color: var(--green);
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.badge-extra {
    margin: 6px 0;
    color: #c8c8c8;
}

/* =========================
   CHARTS
   ========================= */

.chart-card {
    margin-top: 10px;
    padding: 24px;
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 24px;
    min-height: 280px;
}

.chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-value {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 24px;
    font-weight: bold;
}

.chart-bar-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 120px;
    height: 200px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.chart-bar {
    width: 100%;
    min-height: 6px;
    border-radius: 14px 14px 10px 10px;
    transition: 0.3s ease;
}

.chart-bar-checkin {
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
    box-shadow: 0 0 18px rgba(57, 255, 136, 0.25);
}

.chart-bar-checkout {
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    box-shadow: 0 0 18px rgba(255, 80, 80, 0.20);
}

.chart-bar-present {
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.20);
}

.chart-label {
    margin-top: 12px;
    color: var(--text-soft);
    font-weight: bold;
    text-align: center;
}

/* =========================
   MOBILE TABLES AS CARDS
   ========================= */

.mobile-cards-table {
    overflow: visible;
}

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

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .topbar,
    .badge-actions {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }

    .badge-card-print {
        max-width: 100% !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    .badge-name,
    .badge-info,
    .badge-code-text,
    .badge-extra,
    .badge-top-label {
        color: #000000 !important;
        background: transparent !important;
        border-color: #000000 !important;
        box-shadow: none !important;
    }
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
    .attendance-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .scan-layout,
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 14px;
    }

    .topbar-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    .topbar h1 {
        flex: 1;
        margin: 0;
        font-size: 18px;
        line-height: 1.2;
        word-break: break-word;
    }

    .topbar .desktop-nav {
        display: none !important;
    }

    .burger-btn {
        display: inline-flex !important;
    }

    .topbar .mobile-menu {
        display: none !important;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 14px;
        padding: 14px;
        border: 1px solid var(--green-border);
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(12, 12, 12, 0.98), rgba(7, 7, 7, 0.98));
        box-shadow: var(--panel-shadow);
    }

    .topbar .mobile-menu.open {
        display: flex !important;
    }

    .topbar .mobile-menu a {
        width: 100%;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 20px auto;
        padding: 14px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
        overflow-x: hidden;
    }

    form,
    .table-box,
    .card,
    .login-box,
    .hero-box,
    .scan-panel,
    .scan-side-card,
    .chart-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 16px;
        border-radius: 20px;
        overflow-x: hidden;
    }

    form {
        gap: 18px;
    }

    label {
        margin-bottom: 12px;
    }

    input,
    select,
    textarea {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-top: 0;
    }

.checkbox-inline {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    margin-left: 0 !important;
}

.checkbox-inline input[type="checkbox"] {
    display: inline-block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    flex: 0 0 24px !important;
    margin: 0 !important;
}

.checkbox-inline span {
    display: inline-block !important;
    margin: 0 !important;
}
    input[type="date"],
    input[type="time"] {
        -webkit-appearance: none;
        appearance: none;
        min-height: 64px;
        padding: 16px 18px;
        border-radius: 16px;
        font-size: 19px;
        line-height: 1.2;
    }

    .page-title {
        font-size: 22px;
        line-height: 1.15;
    }

    .page-subtitle,
    .hero-subtitle,
    .scan-text {
        font-size: 15px;
        line-height: 1.45;
    }

    .hero-title {
        font-size: 26px;
    }

    .scan-title {
        font-size: 24px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .dashboard-date-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-date-grid .filter-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .action-switch {
        grid-template-columns: 1fr;
    }

    .action-big {
        font-size: 20px;
    }

    .reader-box {
        min-height: 260px;
        padding: 10px;
    }

    .reader-box::before {
        padding: 7px 12px;
        font-size: 12px;
    }

    .badge-card-print {
        padding: 20px 16px;
    }

    .badge-name {
        font-size: 22px;
        line-height: 1.2;
    }

    .badge-code-text {
        font-size: 18px;
        word-break: break-word;
    }

    .chart-bars {
        gap: 14px;
        min-height: 220px;
    }

    .chart-bar-wrap {
        max-width: 90px;
        height: 160px;
    }

    .chart-value {
        font-size: 20px;
    }

    .chart-label {
        font-size: 14px;
    }

    .filter-actions,
    .camera-actions,
    .badge-actions,
    .book-page-actions,
    .book-detail-actions,
    .workshop-detail-actions,
    .history-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .filter-actions a,
    .filter-actions button,
    .cta-button,
    .scan-submit-btn,
    .badge-actions a,
    .badge-actions button,
    .camera-actions a,
    .camera-actions button,
    .book-page-actions a,
    .book-page-actions button,
    .book-detail-actions a,
    .book-detail-actions button,
    .workshop-detail-actions a,
    .workshop-detail-actions button,
    .history-actions a,
    .history-actions button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
    }

    .workshop-form {
        gap: 10px !important;
    }

    .workshop-form label,
    .child-form label {
        margin-top: 4px;
        margin-bottom: 0 !important;
    }

    .child-form {
        gap: 10px !important;
    }

    .workshop-form input[type="date"],
    .workshop-form input[type="time"],
    .child-form input,
    .child-form select,
    .child-form textarea {
        margin-top: -2px;
    }

    .mobile-cards-table {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .mobile-cards-table table,
    .mobile-cards-table thead,
    .mobile-cards-table tbody,
    .mobile-cards-table th,
    .mobile-cards-table td,
    .mobile-cards-table tr {
        display: block !important;
        width: 100% !important;
    }

    .mobile-cards-table table {
        min-width: 0 !important;
        margin-top: 0 !important;
    }

    .mobile-cards-table thead {
        display: none !important;
    }

    .mobile-cards-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .mobile-cards-table tr {
        margin: 0 !important;
        padding: 14px !important;
        border: 1px solid var(--green-border) !important;
        border-radius: 22px !important;
        background: var(--panel-bg) !important;
        box-shadow: var(--panel-shadow) !important;
        overflow: hidden !important;
    }

    .mobile-cards-table td {
        padding: 10px 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        background: transparent !important;
        color: #f1f1f1 !important;
        text-align: left !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .mobile-cards-table td:last-child {
        border-bottom: none !important;
    }

    .mobile-cards-table td::before {
        content: attr(data-label) !important;
        display: block !important;
        margin-bottom: 6px !important;
        color: var(--text-dim) !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.6px !important;
    }

    .mobile-cards-table td[data-label="Actions"] {
        padding-top: 14px !important;
    }

    .mobile-cards-table .mobile-action-stack {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .mobile-cards-table .mobile-action-stack a,
    .mobile-cards-table .mobile-action-stack button {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
    }
}

@media (max-width: 640px) {
    .scan-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .topbar {
        padding: 14px 12px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .page-title {
        font-size: 18px;
    }

    .hero-title {
        font-size: 22px;
    }

    .card h3 {
        font-size: 28px;
    }

    .reader-box {
        min-height: 220px;
    }
}
/* =========================
   WORKSHOPS - RECHERCHE MOBILE
   ========================= */

.workshop-filter-grid {
    grid-template-columns: 2fr auto;
}

@media (max-width: 768px) {
    .workshop-filter-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .workshop-filter-grid .filter-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .workshop-filter-grid .filter-actions a,
    .workshop-filter-grid .filter-actions button {
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}
/* =========================
   CHILDREN TABLE - ACTIONS PROPRES
   ========================= */

.children-actions-cell {
    width: 190px;
    min-width: 190px;
    vertical-align: top;
}

.children-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.children-actions-stack a,
.children-actions-stack button,
.children-actions-stack form {
    margin: 0 !important;
}

.children-actions-stack a,
.children-actions-stack button {
    width: 150px;
    text-align: center;
    box-sizing: border-box;
}

.children-actions-stack form {
    width: 150px;
}

.children-actions-stack form button {
    width: 100%;
}

@media (max-width: 768px) {
    .children-actions-cell {
        width: 100% !important;
        min-width: 0 !important;
    }

    .children-actions-stack {
        align-items: stretch !important;
        width: 100% !important;
    }

    .children-actions-stack a,
    .children-actions-stack button,
    .children-actions-stack form {
        width: 100% !important;
        max-width: 100% !important;
    }
}
