/* ===== PAGE DE CONNEXION ===== */

.login-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
}

.login-box {
    width: 100%;
    max-width: 360px;
    padding: 32px 28px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    display: block;
    max-width: 180px;
    height: auto;
    margin: 0 auto 12px;
}

.login-brand {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: bold;
    color: #013c7b;
}

.login-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #666;
}

.login-page h1 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #222;
}

.login-error {
    margin: 0 0 16px;
    padding: 10px;
    background: #fde8e8;
    color: #b00020;
    border-radius: 5px;
    font-size: 14px;
}

.login-form {
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.login-form input {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.login-form button {
    width: 100%;
    margin-top: 4px;
    cursor: pointer;
}

/* ===== BASE APP ===== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f5f7fa;
    color: #222;
    line-height: 1.5;
}

h1 {
    font-size: 24px;
    margin: 0 0 8px;
    color: #013c7b;
}

h2 {
    margin-top: 25px;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    color: #013c7b;
}

.app-main {
    padding: 20px 16px 80px;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== HEADER ===== */

.app-header {
    background: #013c7b;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    min-width: 0;
}

.app-brand img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.app-brand-text strong {
    font-size: 15px;
}

.app-brand-text small {
    font-size: 11px;
    opacity: 0.85;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
}

.app-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
}

.app-nav a:hover,
.app-nav a.active {
    background: rgba(255, 255, 255, 0.18);
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    font-size: 14px;
}

.app-username {
    opacity: 0.9;
}

.app-logout {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.app-logout:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===== BOUTONS ===== */

button,
a.button,
.btn-small {
    display: inline-block;
    padding: 10px 14px;
    background: #013c7b;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}

button:hover,
a.button:hover,
.btn-small:hover {
    background: #0250a3;
}

a.button.btn-outline,
.btn-small.btn-outline {
    background: #fff;
    color: #013c7b !important;
    border: 1px solid #013c7b;
}

a.button.btn-outline:hover,
.btn-small.btn-outline:hover {
    background: #e8eef5;
}

/* ===== FORMULAIRES ===== */

input,
textarea,
select {
    padding: 10px;
    width: 100%;
    max-width: 500px;
    margin-top: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #013c7b;
    box-shadow: 0 0 0 2px rgba(1, 60, 123, 0.15);
}

.panel {
    background: #fff;
    padding: 16px 18px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

/* ===== BADGES STATUT ===== */

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    line-height: 1.3;
}

.status-open {
    background: #dbeafe;
    color: #1e40af;
}

.status-diagnostic {
    background: #ede9fe;
    color: #5b21b6;
}

.status-waiting {
    background: #ffedd5;
    color: #c2410c;
}

.status-repair {
    background: #e0f2fe;
    color: #0369a1;
}

.status-done {
    background: #dcfce7;
    color: #166534;
}

.status-closed {
    background: #f3f4f6;
    color: #4b5563;
}

.status-default {
    background: #e5e7eb;
    color: #374151;
}

/* ===== LISTE INTERVENTIONS ===== */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header h1 {
    margin: 0;
}

.list-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-field {
    flex: 1 1 180px;
}

.filter-field label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #444;
}

.filter-search {
    flex: 2 1 260px;
}

.filter-field input,
.filter-field select {
    width: 100%;
    max-width: none;
    margin: 0;
}

.filter-actions button {
    margin: 0;
    min-height: 42px;
}

.status-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.status-form label {
    font-weight: bold;
}

.status-form select {
    width: auto;
    min-width: 200px;
    margin: 0;
}

.status-form button {
    margin: 0;
}

button.btn-danger {
    background: #b00020;
}

button.btn-danger:hover {
    background: #8f0019;
}

.list-secondary-link {
    margin: -8px 0 16px;
    font-size: 13px;
}

.list-secondary-link a {
    color: #666;
    text-decoration: none;
}

.list-secondary-link a:hover {
    color: #013c7b;
    text-decoration: underline;
}

.list-summary {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
}

/* Tableau desktop */
.interventions-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.interventions-table th,
.interventions-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.interventions-table th {
    background: #013c7b;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}

.interventions-table tbody tr:hover {
    background: #f8fafc;
}

.interventions-table tbody tr:last-child td {
    border-bottom: none;
}

.col-numero {
    font-weight: bold;
    color: #013c7b;
    white-space: nowrap;
}

.col-materiel {
    color: #555;
    font-size: 13px;
}

.col-date {
    white-space: nowrap;
    color: #666;
    font-size: 13px;
}

.col-actions {
    white-space: nowrap;
}

.col-actions .btn-small {
    padding: 6px 10px;
    font-size: 13px;
    margin-right: 4px;
}

/* Cartes mobile */
.mobile-list {
    display: none;
}

.intervention-card {
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.intervention-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.intervention-card-title strong {
    display: block;
    font-size: 16px;
    color: #013c7b;
}

.intervention-card-client {
    display: block;
    font-size: 15px;
    color: #222;
    margin-top: 2px;
}

.intervention-card-materiel {
    margin: 0 0 6px;
    font-size: 14px;
    color: #555;
}

.intervention-card-date {
    margin: 0 0 12px;
    font-size: 13px;
    color: #888;
}

.intervention-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.intervention-card-actions .button {
    margin: 0;
    padding: 12px;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.empty-state-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 8px;
    color: #013c7b;
}

.empty-state-text {
    margin: 0 0 20px;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pagination-nav {
    padding: 8px 12px;
    background: #013c7b;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
}

.pagination-nav:hover {
    background: #0250a3;
}

.pagination-mobile-info {
    display: none;
    font-size: 14px;
    font-weight: bold;
    color: #013c7b;
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pagination-pages a,
.pagination-current,
.pagination-ellipsis {
    display: inline-block;
    min-width: 36px;
    text-align: center;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.pagination-pages a {
    background: #e8eef5;
    color: #013c7b !important;
    text-decoration: none;
}

.pagination-pages a:hover {
    background: #d0dceb;
}

.pagination-current {
    background: #013c7b;
    color: #fff;
    font-weight: bold;
}

.pagination-ellipsis {
    color: #666;
    padding: 8px 4px;
}

.pagination-disabled {
    padding: 8px 12px;
    color: #999;
    font-size: 14px;
}

/* Bouton flottant mobile */
.fab-new {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    background: #013c7b;
    color: #fff !important;
    font-size: 28px;
    line-height: 56px;
    text-align: center;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.fab-new:hover {
    background: #0250a3;
}

/* ===== LEGACY (autres pages) ===== */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

th, td {
    border: 1px solid #eee;
    padding: 10px 12px;
}

th {
    background: #013c7b;
    color: #fff;
}

.card {
    background: white;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.action-bar a {
    background: #013c7b !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border-radius: 5px !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
}

/* ===== MOBILE ===== */

@media (max-width: 768px) {

    .app-header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .app-nav {
        order: 3;
        width: 100%;
    }

    .app-nav a {
        flex: 1 1 auto;
        text-align: center;
        background: rgba(255, 255, 255, 0.08);
    }

    .app-header-user {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .app-main {
        padding: 16px 12px 90px;
    }

    .btn-desktop {
        display: none !important;
    }

    .fab-new {
        display: block;
    }

    .interventions-table,
    table {
        display: none;
    }

    .mobile-list {
        display: block;
    }

    .list-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-field,
    .filter-search {
        flex: 1 1 100%;
    }

    .filter-actions button {
        width: 100%;
    }

    input,
    textarea,
    select,
    button {
        max-width: none;
    }

    .pagination-pages {
        display: none;
    }

    .pagination-mobile-info {
        display: inline-block;
    }

    .action-bar a {
        flex: 1 1 45%;
    }

    .card-actions a {
        display: block;
        background: #013c7b;
        color: white;
        padding: 10px;
        margin-top: 8px;
        text-align: center;
        border-radius: 5px;
        text-decoration: none;
    }
}
