/*************************************
 * RESET & GLOBAL
*************************************/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, sans-serif;
}

body {
    background: #f4f6f8;
    color: #222;
    line-height: 1.6;
}

/*************************************
 * HEADER
*************************************/
header {
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
}
.logo:hover {
    text-decoration: none;
    color: #ffffff;
}


.burger {
    display: none;
    font-size: 26px;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .burger {
        display: block;
    }
}

/*************************************
 * PAGE LAYOUT
*************************************/
main {
    padding: 20px;
}

h1 {
    margin-bottom: 15px;
    font-size: 28px;
}

.card {
    max-width: 420px;
    margin: 40px auto;
    padding: 25px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    animation: fadeIn 0.3s ease;
}

.card h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.6em;
    color: #222;
}

/*************************************
 * FORMS
*************************************/
.form-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-label {
    font-weight: 600;
    color: #333;
}

.form-input,
.login-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    background: #fafafa;
    transition: 0.2s;
}

.form-input:focus,
.login-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.btn-login,
.btn-primary {
    background: #007BFF;
    color: white;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.btn-login:hover,
.btn-primary:hover {
    background: #0056cc;
}

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

.rwd-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.rwd-table th,
.rwd-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

.rwd-table thead {
    background: #1f2937;
    color: white;
}

@media (max-width: 768px) {
    .rwd-table thead {
        display: none;
    }
    .rwd-table tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        padding: 12px;
        background: #f9fafb;
        box-shadow: 0 1px 5px rgba(0,0,0,0.08);
    }
    .rwd-table td {
        display: flex;
        justify-content: space-between;
    }
    .rwd-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        font-size: 14px;
    }
}

/*************************************
 * LOGIN PAGE
*************************************/
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 60px);
}

.login-container {
    max-width: 380px;
    padding: 20px;
}

.login-card {
    background: #fff;
    padding: 30px 25px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.10);
    text-align: center;
}

/*************************************
 * FOOTER
*************************************/
footer {
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
}

/*************************************
 * ACTION BUTTONS
*************************************/
.act,
.act-edit,
.act-reset,
.act-delete,
a.act,
a.act-edit,
a.act-reset,
a.act-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    padding: 6px;
    margin: 0 4px;
    border-radius: 6px;
    transition: transform 0.1s ease, opacity 0.1s ease;
    text-decoration: none !important; /* jamais de souligné */
}

.act-edit   { color: #2a7ae4; }
.act-reset  { color: #d97706; }
.act-delete { color: #d43c2d; }

.act:active,
a.act:active,
a.act-edit:active,
a.act-reset:active,
a.act-delete:active {
    transform: scale(0.88);
    opacity: 0.5;
}


/*************************************
 * ADD BUTTON (floating)
*************************************/
.btn-add-round,
a.btn-add-round,
a.btn-add-round:visited,
a.btn-add-round:hover,
a.btn-add-round:active {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;

    background: #ffffff;       /* fond blanc */
    border: 2px solid #ff0000; /* contour rouge */
    color: #1f8bff;            /* symbole bleu */
    text-decoration: none !important; /* interdit le souligné */
    z-index: 120;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-add-round:active {
    transform: scale(0.92);
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
}


/*************************************
 * LOGIN HEADER
*************************************/
.header-centered {
    justify-content: center !important;
}

/*************************************
 * OFFLINE BANNER
*************************************/
.offline-banner {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #fca5a5;
    position: sticky;
    top: 0;
    z-index: 2000;
}

/*************************************
 * MENU LATERAL — FINAL
*************************************/
#menu {
    display: none;              /* hidden at first */
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    background: #1f2937;
    width: 220px;
    border-radius: 0 0 0 12px;
    box-shadow: -2px 4px 8px rgba(0,0,0,0.2);
    padding: 10px 16px;
}

#menu.open {
    display: flex;
}

#menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 16px;
    color: #ffffff;
    opacity: 0.92;
    text-decoration: none;
}

#menu a:hover {
    opacity: 1;
    transform: translateX(4px);
}

.menu-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    opacity: 0.75;
    margin-top: 14px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.menu-separator {
    height: 1px;
    background: rgba(255,255,255,0.18);
    margin: 8px 0;
}

.menu-user {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.li-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
}

.li-dot.red {
    background: #ff4444;
}

.menu-logout {
    color: #ff4444 !important;
    font-weight: 600;
    padding: 8px 0;
}

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

.table-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
}

.act-edit {
  font-size: 18px;
  cursor: pointer;
  background: none;
  border: none;
}

.act-edit:hover {
  transform: scale(1.2);
}

.flash {
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.flash-error {
  background: #ffdddd;
  border-left: 4px solid #e60000;
  color: #800;
}

.flash-success {
  background: #ddffdd;
  border-left: 4px solid #009900;
  color: #040;
}

.flash-warning {
  background: #fff5cc;
  border-left: 4px solid #e6b800;
  color: #725;
}

.flash-info {
  background: #dde7ff;
  border-left: 4px solid #0047e6;
  color: #003080;
}

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

.site-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.site-btn {
    padding: 14px 18px;
    border-radius: 10px;
    border: 2px solid #999;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 18px;
    flex: 1 1 45%;
    text-align: center;
    transition: 0.2s;
}

.site-btn.active {
    background: #1f8bff;
    color: white;
    border-color: #1f8bff;
    font-weight: bold;
}

/* Switch ON/OFF */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-right: 10px;
}

.switch input { display: none; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1f8bff;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch-label {
    vertical-align: middle;
    font-size: 16px;
}
