body { font-family: Arial, sans-serif; margin: 0; display: flex; font-size: 16px; }
.sidebar {
    width: 250px;
    flex-shrink: 0;          /* no encogerse cuando el contenido es ancho (ej. inventario) */
    background-color: #2c3e50;
    color: white;
    padding: 25px;
    height: 100vh;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: sticky;
    top: 0;
}
.sidebar h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #ecf0f1;
    font-size: 24px;
}
.sidebar > ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.sidebar .nav-bottom-item {
    margin-top: auto;
    order: 100;
}
.sidebar ul li {
    margin-bottom: 12px;
}
.sidebar ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px 18px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}
.sidebar ul li a:hover, .sidebar ul li a.active {
    background-color: #34495e;
}
.sidebar ul li { margin-bottom: 4px; }

/* ── Secciones colapsables del menú ── */
.sidebar .nav-section-toggle {
    color: #cfd8e3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    cursor: pointer;
}
.sidebar .nav-section-toggle:hover { background-color: #34495e; color: #fff; }
.sidebar .nav-section-toggle .chev {
    float: right;
    font-size: 0.8em;
    margin-top: 3px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}
.sidebar .nav-section-toggle.open .chev { transform: rotate(180deg); }

.sidebar .nav-subgroup {
    list-style: none;
    padding: 2px 0 2px 0;
    margin: 0 0 4px 10px;
    border-left: 2px solid rgba(255,255,255,0.12);
}
.sidebar .nav-subgroup li { margin-bottom: 2px; }
.sidebar .nav-subgroup li a {
    padding: 8px 14px;
    font-size: 14px;
    color: #e8edf2;
}
.sidebar .nav-subgroup li a.active {
    background-color: #1f6feb;
    color: #fff;
    font-weight: 600;
}
.pending-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.content {
    flex-grow: 1;
    min-width: 0;            /* permite que tablas anchas hagan scroll interno en vez de empujar el layout */
    padding: 30px;
    background-color: #f8f9fa;
}
h1 { font-size: 28px; margin-bottom: 25px; }
table { width: 100%; border-collapse: collapse; margin-top: 25px; }
th, td { border: 2px solid black; padding: 10px; text-align: left; }
.add-button, .edit-button { background-color: #007bff; color: white; padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; margin-right: 5px; }
.form-top-button { margin-bottom: 20px; }
.add-button:hover, .edit-button:hover { background-color: #0056b3; }
.flash-message { padding: 10px; margin-bottom: 15px; border-radius: 4px; color: #333; border: 1px solid #c8cbcf; }
.flash-success { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.flash-error { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.logout-button { margin-top: auto; text-align: center; }
.logout-button a { background-color: #e74c3c; color: white; padding: 10px 15px; border-radius: 4px; text-decoration: none; display: block; transition: background-color 0.3s ease; }
.logout-button a:hover { background-color: #c0392b; }
.app-form { background: #f9f9f9; padding: 20px; border-radius: 8px; max-width: 500px; margin: 25px auto; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.app-form div { margin-bottom: 15px; }
.app-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
.app-form input[type="text"],
.app-form input[type="number"],
.app-form input[type="password"],
.app-form input[type="email"],
.app-form input[type="tel"],
.app-form textarea,
.app-form select { width: calc(100% - 22px); padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 16px; }
.app-form button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
}
.app-form button[type="submit"]:hover { background-color: #0056b3; }
.remove-button { background-color: #dc3545; color: white; padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; margin-left: 5px; }
.remove-button:hover { background-color: #c82333; }
.app-form-submit-button { background-color: #28a745; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 1.1em; width: 100%; margin-top: 20px; transition: background-color 0.3s ease; }
.app-form-submit-button:hover { background-color: #218838; }
.add-user-button { background-color: #007bff; color: white; padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; margin-left: 10px; font-size: 0.9em; }
.add-user-button:hover { background-color: #0056b3; }
body.login-page { font-family: Arial, sans-serif; margin: 20px; background-color: #f4f4f4; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-container { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 100%; max-width: 350px; text-align: center; }
.login-container h1 { color: #333; margin-bottom: 20px; }
.login-container div { margin-bottom: 15px; text-align: left; }
.login-container label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
.login-container input[type="text"], .login-container input[type="password"] { width: calc(100% - 22px); padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.login-container button[type="submit"] { background-color: #007bff; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; width: 100%; }
.login-container button[type="submit"]:hover { background-color: #0056b3; }
.pagination { margin-top: 30px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.page-link { display: inline-block; padding: 8px 14px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #007bff; transition: background-color 0.3s ease, color 0.3s ease; }
.page-link:hover { background-color: #007bff; color: white; }
.page-link.active { background-color: #007bff; color: white; border-color: #007bff; font-weight: bold; }
.page-link[disabled] { opacity: 0.6; cursor: not-allowed; }
.ellipsis { padding: 8px 14px; color: #555; }
.timeline { border-left: 2px solid #007bff; padding-left: 15px; margin-left: 10px; }
.timeline-item { position: relative; margin-bottom: 12px; }
.timeline-item::before { content: ''; position: absolute; left: -10px; top: 6px; width: 10px; height: 10px; background-color: #007bff; border-radius: 50%; }
.timeline-date { font-size: 0.85em; color: #6c757d; }
.admin-menu {
    margin-top: 25px;
}
.admin-menu > a {
    color: #ecf0f1;
    display: block;
    background-color: #1f2c3b;
    padding: 12px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.admin-menu > a:hover {
    background-color: #34495e;
}
.admin-menu ul {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    background-color: #243447;
    border-radius: 4px;
    overflow: hidden;
}
.admin-menu ul li { margin: 0; }
.admin-menu ul li a {
    font-size: 0.95em;
    color: #ecf0f1;
    padding: 10px 16px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-menu ul li:last-child a {
    border-bottom: none;
}
.admin-menu ul li a.active,
.admin-menu ul li a:hover {
    background-color: #1d2733;
}
.admin-menu ul.show { display: block !important; }
.admin-menu ul.collapse { display: none; }

/* Inventario responsive */
.inventory-table-wrapper {
    overflow-x: visible;
}
.inventory-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.92rem;
}
.inventory-table th,
.inventory-table td {
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
}
.inventory-table td a {
    word-break: break-all;
}
.inventory-table .btn-group .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}

/* ── Dark Mode Toggle ───────────────────────────────────────────────────── */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    cursor: pointer;
    color: #bdc3c7;
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.dark-mode-toggle:hover {
    background-color: #34495e;
}
.dark-mode-toggle i {
    margin-right: 6px;
}

/* ── Dark Mode Styles ───────────────────────────────────────────────────── */
body.dark-mode .content {
    background-color: #1a1a2e;
    color: #e0e0e0;
}
body.dark-mode .sidebar {
    background-color: #16213e;
}
body.dark-mode .sidebar h2 {
    color: #a0c4ff;
}
body.dark-mode .admin-menu > a {
    background-color: #0f1a2e;
}
body.dark-mode .admin-menu ul {
    background-color: #131d33;
}
body.dark-mode .card {
    background-color: #16213e;
    border-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .card-header {
    background-color: #1a2744;
    border-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .table {
    color: #e0e0e0;
}
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.03);
}
body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.07);
}
body.dark-mode .thead-dark th {
    background-color: #0f3460;
}
body.dark-mode .form-control {
    background-color: #1a2744;
    border-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .form-control:focus {
    background-color: #1f2f4f;
    border-color: #4a6fa5;
    color: #e0e0e0;
}
body.dark-mode .form-control::placeholder {
    color: #6c7a8d;
}
body.dark-mode select.form-control {
    background-color: #1a2744;
    color: #e0e0e0;
}
body.dark-mode .btn-outline-secondary {
    color: #a0b4cc;
    border-color: #3a4f6f;
}
body.dark-mode .btn-outline-secondary:hover {
    background-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .alert-light {
    background-color: #1a2744;
    border-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .alert {
    color: #e0e0e0;
}
body.dark-mode .text-muted {
    color: #8899aa !important;
}
body.dark-mode a {
    color: #6db3f2;
}
body.dark-mode .list-group-item {
    background-color: #16213e;
    border-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .badge-light {
    background-color: #2a3a5c;
    color: #e0e0e0;
}
body.dark-mode .modal-content {
    background-color: #16213e;
    color: #e0e0e0;
}
body.dark-mode .modal-header {
    border-color: #2a3a5c;
}
body.dark-mode .modal-footer {
    border-color: #2a3a5c;
}
body.dark-mode .close {
    color: #e0e0e0;
}
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #e0e0e0;
}
body.dark-mode .shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,0.3) !important;
}
body.dark-mode .bg-light {
    background-color: #1a2744 !important;
}
body.dark-mode .progress {
    background-color: #2a3a5c;
}
body.dark-mode .custom-control-label {
    color: #e0e0e0;
}

/* ── Setup / Settings ──────────────────────────────────────────────────── */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 2px solid #007bff;
    padding-bottom: 6px;
    margin-bottom: 15px;
    margin-top: 25px;
}
.logo-preview {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
}
body.dark-mode .section-title {
    color: #a0c4ff;
}
body.dark-mode .logo-preview {
    border-color: #2a3a5c;
}
