/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================================
   BODY
========================================================= */

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

/* =========================================================
   LAYOUT
========================================================= */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 240px;
    background: #0f172a;
    color: white;
    padding: 24px 14px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
}

.brand h1 {
    font-size: 18px;
    margin-bottom: 4px;
}

.brand p {
    font-size: 13px;
    color: #cbd5e1;
}

/* =========================================================
   MENU
========================================================= */

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 12px;
    transition: 0.2s;
}

.menu a:hover {
    background: rgba(255,255,255,0.08);
}

.menu a.active {
    background: rgba(255,255,255,0.10);
}

/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
    flex: 1;
    padding: 28px;
}

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

.topbar {
    background: white;
    border-radius: 18px;
    padding: 26px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.topbar h2 {
    font-size: 28px;
    margin-bottom: 6px;
}

.topbar p {
    color: #6b7280;
}

/* =========================================================
   USER BOX
========================================================= */

.user-box {
    display: flex;
    gap: 12px;
}

.user-box a {
    background: #111827;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
}

.user-box a:hover {
    background: #1f2937;
}

/* =========================================================
   PANELS
========================================================= */

.panel {
    background: white;
    border-radius: 18px;
    padding: 24px;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 22px;
}

/* =========================================================
   TABLES
========================================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 14px;
    background: #f8fafc;
    color: #374151;
    font-size: 14px;
}

.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid #e5e7eb;
}

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

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

label {
    font-weight: 700;
    color: #111827;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 15px;
}

textarea {
    resize: vertical;
}

button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

button:hover {
    background: #1d4ed8;
}

/* =========================================================
   ALERTS
========================================================= */

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.success {
    background: #dcfce7;
    color: #166534;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}

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

.badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge-faible {
    background: #dcfce7;
    color: #166534;
}

.badge-normale {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-urgente {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================================
   BUTTONS
========================================================= */

.btn-small {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    background: #2563eb;
    color: white;
    font-size: 14px;
}

.btn-small:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #dc2626 !important;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c !important;
}

/* =========================================================
   VIEW PAGE
========================================================= */

.view-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.view-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.view-item strong {
    display: block;
    margin-bottom: 10px;
}

.description-box {
    margin-top: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    line-height: 1.6;
}

/* =========================================================
   HISTORY
========================================================= */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.history-header span {
    color: #6b7280;
    font-size: 14px;
}

.history-text {
    line-height: 1.6;
}

/* =========================================================
   USERS PAGE
========================================================= */

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 24px;
}

.admin-form-row label {
    margin: 0;
    font-weight: 700;
    color: #111827;
}

.admin-form-row input,
.admin-form-row select {
    width: 100%;
}

.users-table {
    display: flex;
    flex-direction: column;
}

.users-table-header,
.users-row-form {
    display: grid;
    grid-template-columns:
        1fr
        1fr
        1.8fr
        1fr
        1fr
        80px
        150px;
    gap: 12px;
    align-items: center;
}

.users-table-header {
    padding: 14px 12px;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
    color: #374151;
}

.users-table-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.users-row-form {
    flex: 1;
}

.users-row-form input,
.users-row-form select {
    width: 100%;
    min-width: 0;
}

.checkbox-cell {
    display: flex;
    justify-content: center;
}

.checkbox-cell input {
    width: auto;
}

.actions-cell {
    display: flex;
    justify-content: flex-start;
}

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

@media (max-width: 1200px) {

    .admin-form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .users-table-header {
        display: none;
    }

    .users-table-row {
        flex-direction: column;
        align-items: stretch;
    }

    .users-row-form {
        display: flex;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .view-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}
.users-admin-table input,
.users-admin-table select {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.users-admin-table button {
    padding: 10px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.users-admin-table td,
.users-admin-table th {
    vertical-align: middle;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    min-height: 100vh;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 22px;
    padding: 38px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.login-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 22px;
}

.login-card h1 {
    font-size: 34px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #6b7280;
    margin-bottom: 28px;
}

.login-card h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form input {
    width: 100%;
}

.login-form button {
    width: 100%;
    margin-top: 4px;
}

.categories-admin-table input,
.categories-admin-table select {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.categories-admin-table button {
    padding: 10px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.categories-admin-table td,
.categories-admin-table th {
    vertical-align: middle;
}

.services-admin-table input,
.services-admin-table select {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.services-admin-table button {
    padding: 10px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.services-admin-table td,
.services-admin-table th {
    vertical-align: middle;
}