@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

/* Charte cd54-billard.com */
:root {
    --ui-bg-1: #ffffff;
    --ui-bg-2: #f1f5f9;
    --ui-surface: #ffffff;
    --ui-surface-soft: #fff5f2;
    --ui-primary: #dd183b;
    --ui-primary-strong: #cc1939;
    --ui-primary-dark: #8a0d24;
    --ui-navy: #0f172a;
    --ui-text: #1f2937;
    --ui-muted: #6b7280;
    --ui-border: #e5e7eb;
    --ui-accent: #dd183b;
    --ui-secondary: #0f172a;
    --ui-info: #2563eb;
    --ui-danger: #b23a2b;
    --ui-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --ui-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --ui-radius-sm: 8px;
    --ui-radius-md: 12px;
    --ui-radius-lg: 16px;
    --ui-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ui-font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

* {
    box-sizing          : border-box;
    margin              : 0;
    padding             : 0;

  	font-family         : var(--ui-font-body);
    font-weight         : normal;
    font-size           : inherit;
}

html {
    height              : 100%;
}

body {
    display             : flex;
    flex-direction      : column;
    height              : 100vh;
    background          : var(--ui-bg-2);
    color               : var(--ui-text);
}

/* ─── Header ──────────────────────────────────────── */
.header {
    flex-shrink         : 0;
    z-index             : 100;
    background          : #ffffff;
    border-bottom       : 3px solid var(--ui-primary);
    box-shadow          : 0 2px 14px rgba(0, 0, 0, 0.09);
    position            : relative;
}

.header-inner {
    display             : flex;
    align-items         : center;
    justify-content     : space-between;
    padding             : 10px 18px;
    gap                 : 12px;
}

.header-brand {
    display             : flex;
    align-items         : center;
    gap                 : 10px;
}

.header-text {
    display             : flex;
    flex-direction      : column;
    line-height         : 1.25;
}

.header-org {
    font-family         : var(--ui-font-heading);
    font-size           : 0.92rem;
    font-weight         : 700;
    color               : var(--ui-navy);
    letter-spacing      : 0.3px;
}

.header-dept {
    font-family         : var(--ui-font-heading);
    font-size           : 0.72rem;
    font-weight         : 500;
    color               : var(--ui-primary);
    letter-spacing      : 0.2px;
}

.header-nav {
    display             : flex;
    align-items         : center;
    gap                 : 2px;
}

.header-nav-link {
    font-family         : var(--ui-font-heading);
    font-weight         : 600;
    font-size           : 0.8rem;
    text-transform      : uppercase;
    letter-spacing      : 0.4px;
    color               : var(--ui-navy);
    text-decoration     : none;
    padding             : 7px 13px;
    border-radius       : var(--ui-radius-sm);
    transition          : background 0.18s ease, color 0.18s ease;
}

.header-nav-link:hover {
    background          : var(--ui-primary);
    color               : #ffffff;
}

/* ─── Footer ──────────────────────────────────────── */
.footer {
    flex-shrink         : 0;
    z-index             : 100;
    background          : var(--ui-navy);
    color               : rgba(255, 255, 255, 0.85);
    border-top          : 3px solid var(--ui-primary);
    position            : relative;
}

.footer-inner {
    display             : flex;
    align-items         : center;
    justify-content     : center;
    padding             : 11px 18px;
    gap                 : 8px;
    flex-wrap           : wrap;
    position            : relative;
}

.footer-links {
    display             : flex;
    gap                 : 6px;
    align-items         : center;
}

.footer a {
    font-size           : 0.78rem;
    padding             : 5px 12px;
    background          : rgba(255, 255, 255, 0.08);
    color               : rgba(255, 255, 255, 0.88);
    border              : 1px solid rgba(255, 255, 255, 0.18);
    border-radius       : var(--ui-radius-sm);
    text-decoration     : none;
    font-weight         : 600;
    letter-spacing      : 0.3px;
    transition          : all 0.2s ease;
}

.footer a:hover {
    background          : rgba(255, 255, 255, 0.16);
    border-color        : rgba(255, 255, 255, 0.4);
    color               : #ffffff;
}

.footer .footer-requetes {
    position            : absolute;
    right               : 18px;
    top                 : 50%;
    transform           : translateY(-50%);
    font-size           : 0.7rem;
    color               : rgba(255, 255, 255, 0.32);
    white-space         : nowrap;
}

/* Conteneur principal flexible */
.main {
    display: flex;
    flex: 1; /* Prend tout l'espace disponible entre header et footer */
    overflow: hidden; /* Empêche le débordement */
    position: relative; /* Pour positionner la colonne latérale */
}

/* Colonne latérale fixe */
.lateral {
    position            : absolute;
    top                 : 0px;
    left                : 0px;
    bottom              : 0px;
    z-index             : 90;
    margin              : 0px 5px 0px 5px;

    width: 250px;
    background: none;
    overflow-y: auto; /* Ascenseur si le contenu dépasse */
}
.lateral h1, .lateral h2, .lateral h3, .lateral h4, .lateral h5, .lateral h6 {
    text-align			: center;
}
.lateral a {
	text-decoration		: none;
    color				: #000;
}
.lateral p{
    margin				: 0px;
    padding				: 5px;
}

.lateral-image {
    cursor              : pointer;
    opacity             : 0.6;
    transition          : opacity 0.2s ease;
    flex-shrink         : 0;
    display             : block;
}

.lateral-image:hover {
    opacity             : 1;
}

/* Contenu principal défilable */
.contenu {
    flex: 1;
    margin: 5px 5px 5px 0px;

    margin-left: calc(240px + 10px); /* Largeur de la colonne latérale */
    /* padding: 1rem; */
    overflow-y: auto; /* Ascenseur si le contenu dépasse */
    height: 100%; /* Prend toute la hauteur disponible */
    padding: 0 4px 2px;
}


p, div, span, #p, #div, #span {
  	font-family         : var(--ui-font-body);
    font-weight         : normal;
    font-size           : medium;
}

p {
    margin				: 5px 0px 5px 0px;
    padding				: 0px;
}

a {
    color: var(--ui-info);
}

a:hover {
    color: #1d4ed8;
}



h1, h2, h3, h4, h5, h6, #h1, #h2, #h3, #h4, #h5, #h6 {
	width				: auto;
	margin				: 0px;
	padding				: 5px;
    font-family         : var(--ui-font-heading);
    letter-spacing      : 0.2px;
}

h1 {
    font-size           : 1.15rem;
    font-weight         : 700;
    background          : linear-gradient(120deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%);
	color				: white;
    border-radius       : var(--ui-radius-md) var(--ui-radius-md) 0 0;
}

h2 {
	font-size           : large;
    font-weight         : 600;
    background-color    : #061A59;
    color				: white;
    border-bottom       : 3px solid var(--ui-primary);
    border-radius       : 0;
    padding-bottom      : 6px;
}

h3 {
    font-size           : 1.02rem;
    font-weight         : 600;
    background-color	: var(--ui-surface-soft);
	color				: var(--ui-text);
    border-left         : 3px solid var(--ui-primary);
}

h4 {
	background-color	: rgba(0, 0, 0, 0.05);
	font-size           : medium;
}

h5 {
	background-color	: rgba(0, 0, 0, 0.025);
	font-size           : small;
}

ul {
    list-style-type     : disc;
    margin              : 10px 20px;
    padding             : 0px;
}


.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:20px;
    height:20px;
    border:0;
    background:transparent;
    cursor:pointer;
    border-radius:8px;
}
.btn img {
    width: 14px;
    height: 14px;
}
.btn:hover{ 
    background: rgba(0,0,0,0.04);
    transform: translateY(-1px);
}
.btn:active{
    transform: translateY(0);
}

.main-admin .contenu > *,
.main-index .contenu > *,
.main-club .contenu > * {
    animation: riseIn 0.25s ease both;
}

.main-admin .contenu > *:nth-child(2),
.main-index .contenu > *:nth-child(2),
.main-club .contenu > *:nth-child(2) {
    animation-delay: 0.02s;
}

.main-admin .contenu > *:nth-child(3),
.main-index .contenu > *:nth-child(3),
.main-club .contenu > *:nth-child(3) {
    animation-delay: 0.05s;
}

.main-admin .contenu > *:nth-child(4),
.main-index .contenu > *:nth-child(4),
.main-club .contenu > *:nth-child(4) {
    animation-delay: 0.08s;
}

input,
select,
textarea,
button {
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    color: var(--ui-text);
    background: #fff;
    padding: 5px 8px;
    font-size: 0.95rem;
}

button,
input[type="submit"],
input[type="button"] {
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-strong) 100%);
    color: #fff;
    border-color: var(--ui-primary-strong);
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    filter: brightness(1.03);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid rgba(221, 24, 59, 0.35);
    outline-offset: 1px;
}

.ui-message {
    padding: 12px 12px 10px;
    margin: 12px 0;
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-sm);
}

.ui-message-title {
    font-weight: 700;
    margin-bottom: 7px;
}

.ui-message-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.ui-message-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.ui-message-warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.ui-message-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-section-intro {
    margin: 10px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-left: 4px solid var(--ui-primary);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface-soft);
}

.admin-form,
.main-admin .contenu > form,
.main-index .contenu > form,
.main-club .contenu > form {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: 14px 16px;
    max-width: 760px;
    margin: 0 0 20px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

.main-admin .contenu form[style*="border:1px solid #ccc"],
.main-index .contenu form[style*="border:1px solid #ccc"],
.main-club .contenu form[style*="border:1px solid #ccc"],
.main-admin .contenu div[style*="border:1px solid #ccc"],
.main-index .contenu div[style*="border:1px solid #ccc"],
.main-club .contenu div[style*="border:1px solid #ccc"] {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

.main-admin .contenu label[style*="display: inline-block"],
.main-index .contenu label[style*="display: inline-block"],
.main-club .contenu label[style*="display: inline-block"] {
    color: var(--ui-text) !important;
    font-weight: 600 !important;
}

.main-admin .contenu table[style*="border-collapse:collapse"],
.main-index .contenu table[style*="border-collapse:collapse"],
.main-club .contenu table[style*="border-collapse:collapse"] {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-md);
    overflow: hidden;
}

.main-admin .contenu thead[style*="background-color:#f2f2f2"] th,
.main-index .contenu thead[style*="background-color:#f2f2f2"] th,
.main-club .contenu thead[style*="background-color:#f2f2f2"] th {
    background: var(--ui-navy) !important;
    color: #fff !important;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.admin-form-row label {
    font-weight: 600;
    color: var(--ui-text);
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.table-subline {
    font-size: 0.78em;
    color: #4a4a3f;
}

.print-bar {
    text-align: center;
}

.print-bar button {
    padding: 5px 10px;
}

.convocation-list {
    list-style: none;
    margin: 8px 0 16px;
    padding: 0;
}

.convocation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    margin-bottom: 6px;
}

.convocation-label {
    margin-left: 4px;
}

.convocation-link {
    display: inline-flex;
    align-items: center;
}

.convocation-link img,
.convocation-inline .btn img {
    width: 16px;
    height: 16px;
}

.convocation-inline {
    display: inline;
}

.field-label {
    display: inline-block;
}

.field-label-100 {
    width: 100px;
}

.field-label-150 {
    width: 150px;
}

.identity-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--ui-info);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.text-danger {
    color: #b22a2a;
    font-weight: 600;
}

.text-success {
    color: #207447;
    font-weight: 600;
}

.text-muted {
    color: var(--ui-muted);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(221, 24, 59, 0.45);
    outline-offset: 2px;
}

.sc-hidden {
    visibility: hidden;
}

.icon-16 {
    width: 16px;
    height: 16px;
}

.icon-24 {
    width: 24px;
    height: 24px;
}

.plain-item {
    list-style-type: none;
}

.th-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.licence-input {
    width: 70px;
}

.chart-legend {
    margin: 10px 0;
    padding: 10px;
}

.dot-win {
    color: rgb(76, 175, 80);
}

.dot-lose {
    color: rgb(244, 67, 54);
}

.line-player {
    color: rgb(54, 162, 235);
}

.line-opponent {
    color: rgb(255, 159, 64);
}

.chart-canvas {
    margin: auto;
}

.ratio-help {
    font-size: inherit;
    cursor: help;
}

.ratio-cell {
    text-align: center;
}

.ratio-track {
    height: 14px;
    background: #ccc;
    border-radius: 7px;
    overflow: hidden;
    margin: 5px;
}

.ratio-fill {
    height: 100%;
    background: var(--ui-primary);
    width: var(--ratio, 0%);
}

.cell-green-soft {
    background-color: #e0ffe0 !important;
}

.cell-white {
    background-color: #fff !important;
}

.cell-gray {
    background-color: #eee !important;
}

.cell-green {
    background-color: green !important;
}

.cell-red-soft {
    background-color: #ffe0e0 !important;
}

.phase-ok {
    background-color: #d4edda;
}

.phase-ko {
    background-color: #f8d7da;
}

@media (max-width: 760px) {
    .admin-form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body {
        background: var(--ui-bg-1);
    }

    .main-admin .contenu > form,
    .main-index .contenu > form,
    .main-club .contenu > form {
        padding: 12px;
        background: #fff;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }
}
