:root {
    --metallic-blue: #0D0E3E; /* Nuevo color principal */
    --metallic-blue-darker: #0A0B2A; /* Nuevo color más oscuro para hover/bordes */
    --light-gray-bg: #F8F9FA; /* Fondo gris claro */
    --medium-gray: #B0C4DE; /* Gris medio para acentos */
    --dark-text: #333333;
    --light-text: #FFFFFF;
    --border-color: #D1D5DB; /* Gris claro para bordes */
    --danger-color: #DC3545;
    --success-color: #28A745;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray-bg);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%; /* Aumentado para más espacio */
    max-width: 1200px; /* Límite para pantallas grandes */
    margin: 20px auto; /* Margen superior/inferior añadido */
    overflow: hidden;
    padding: 25px;
    background-color: var(--light-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    flex-grow: 1;
}

header {
    background-color: var(--metallic-blue);
    color: var(--light-text);
    padding: 1rem 0; /* Adjusted padding */
    text-align: center;
    display: flex; /* Added for flex layout */
    align-items: center; /* Vertically align items */
    justify-content: center; /* Horizontally center h1 and nav by default */
    position: relative; /* For positioning the logo */
}

header h1 {
    margin: 0 auto; /* Center the h1 as it will be the main in-flow item */
    font-size: 2em; /* Example size, adjust as needed */
}

header nav {
    position: absolute; /* Position nav absolutely */
    right: 20px; /* Distance from the right edge */
    top: 50%; /* Align vertically */
    transform: translateY(-50%); /* Adjust for exact vertical centering */
    display: flex; /* Lay out nav links in a row */
    gap: 15px; /* Space between nav links */
}

header nav a {
    color: var(--light-text);
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

header nav a:hover,
header nav a.active { /* Assuming you might add an 'active' class dynamically */
    background-color: var(--metallic-blue-darker); /* Darken on hover/active */
    text-decoration: underline;
}

header img {
    position: absolute; /* Position logo absolutely within the header */
    left: 20px; /* Distance from the left edge */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for exact vertical centering */
    max-height: 70px; /* Control logo size, adjust as needed */
    width: auto; 
}

main h2 {
    color: var(--metallic-blue-darker);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Forms */
form div {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

form input[type="text"],
form input[type="password"],
form input[type="file"],
form input[type="date"], /* Added date input */
form textarea,
form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="file"]:focus,
form input[type="date"]:focus,
form textarea:focus,
form select:focus {
    border-color: var(--metallic-blue);
    box-shadow: 0 0 0 0.2rem rgba(10, 74, 143, 0.25);
    outline: none;
}

form textarea {
    height: 120px;
    resize: vertical;
}

form button[type="submit"],
button {
    display: inline-block;
    background: var(--metallic-blue);
    color: var(--light-text);
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

form button[type="submit"]:hover,
button:hover {
    background: var(--metallic-blue-darker);
}

.instructions {
    background-color: #e6f0fa; /* Light blue background */
    padding: 20px;
    border-left: 5px solid var(--metallic-blue);
    margin-bottom: 25px;
    border-radius: 6px;
}

.instructions h3 {
    margin-top: 0;
    color: var(--metallic-blue-darker);
    font-size: 1.5rem; /* Increased font size for the heading */
    margin-bottom: 15px; /* Added space below the heading */
}

.instructions ul {
    list-style-type: none; /* Remove default bullets */
    padding-left: 0; /* Remove default padding */
}

.instructions li {
    padding: 10px 0; /* Add padding above and below each item */
    border-bottom: 1px solid #d1e0f0; /* Lighter separator line */
    line-height: 1.5; /* Improve readability of longer instructions */
}

.instructions li:last-child {
    border-bottom: none; /* No border for the last item */
}

.instructions p {
    margin: 0;
    color: var(--metallic-blue-darker);
}

/* Admin Panel Specifics */
.admin-panel-controls {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-between; /* Space out sections */
    align-items: center;
    gap: 20px; /* Space between control groups */
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-gray-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.empresa-tabs {
    display: flex;
    gap: 10px;
}

.empresa-tabs button,
.admin-panel-controls input[type="text"],
.admin-panel-controls input[type="date"] {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.empresa-tabs button {
    background-color: var(--medium-gray);
    color: var(--dark-text);
    font-weight: 500;
}

.empresa-tabs button:hover,
.empresa-tabs button.active { /* Add an active class via JS if needed */
    background-color: var(--metallic-blue-darker);
    color: var(--light-text);
    border-color: var(--metallic-blue-darker);
}

.admin-panel-controls input[type="text"] {
    flex-grow: 1; /* Allow search input to take more space */
    min-width: 200px; /* Minimum width for search */
}

#registrosContainer table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px; /* Rounded corners for the table */
    overflow: hidden; /* Ensures border-radius is applied to child elements */
}

#registrosContainer th,
#registrosContainer td {
    border: none; /* Remove individual cell borders for a cleaner look */
    padding: 15px; /* Increased padding */
    text-align: left;
    border-bottom: 1px solid var(--border-color); /* Horizontal lines */
    vertical-align: top; /* Align content to the top */
}

#registrosContainer th {
    background-color: var(--metallic-blue);
    color: var(--light-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

#registrosContainer tr:last-child td {
    border-bottom: none; /* No border for the last row */
}

#registrosContainer tr:nth-child(even) {
    background-color: var(--light-gray-bg);
}

#registrosContainer tr:hover {
    background-color: #e9ecef; /* Light hover effect for rows */
}

/* Style for the 'Acciones' column cell */
#registrosContainer td:last-child {
    width: 130px; /* Slightly reduced width, adjust as needed */
    padding: 15px 10px; /* Keep vertical padding, adjust horizontal if needed */
    box-sizing: border-box;
}

#registrosContainer .action-button {
    display: block; /* Stack buttons vertically */
    width: 100%;    /* Buttons take full width of the parent cell's content box */
    padding: 8px 10px; /* Adjusted padding slightly */
    margin-bottom: 8px; /* Space between stacked buttons */
    font-size: 0.9rem;
    text-align: center; /* Center text within the button */
    background-color: var(--medium-gray);
    color: var(--dark-text);
    border: none;
    border-radius: 6px;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#registrosContainer .action-button:last-child {
    margin-bottom: 0; /* No margin for the last button in the stack */
}

#registrosContainer .action-button:hover {
    background-color: var(--metallic-blue-darker);
    color: var(--light-text);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Darker overlay */
    padding-top: 60px; /* Space from top */
}

.modal-content {
    background-color: var(--light-text);
    margin: auto; /* Centered */
    padding: 30px;
    border: none; /* Removed border, rely on shadow */
    width: 60%; /* Adjust as needed, can be responsive */
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    position: relative;
    animation: fadeInModal 0.3s ease-out;
}

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

.close-button {
    color: #888;
    position: absolute; /* Position relative to modal-content */
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    transition: color 0.2s ease;
    cursor: pointer; /* Ensure cursor shows as pointer */
    user-select: none; /* Prevent text selection */
    z-index: 1001; /* Ensure it's above other modal content */
    line-height: 1; /* Normalize line height */
    width: 32px; /* Set explicit width */
    height: 32px; /* Set explicit height */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.close-button:hover,
.close-button:focus {
    color: var(--dark-text);
    text-decoration: none;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.1); /* Add subtle background on hover */
    border-radius: 50%; /* Make it circular */
}

#modalRecordDetails p {
    margin-bottom: 12px;
    line-height: 1.7;
}
#modalRecordDetails strong {
    color: var(--metallic-blue-darker);
}
#modalRecordDetails pre {
    background-color: var(--light-gray-bg);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap; /* Wrap long lines */
    word-break: break-all;
}

#modalRecordImages {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center; /* Center images if they don't fill the row */
}

#modalRecordImages img {
    max-width: 150px; /* Slightly smaller for multiple images */
    max-height: 150px;
    margin: 0; /* Removed margin as gap is used */
    border: 2px solid var(--border-color);
    border-radius: 6px;
    object-fit: cover; /* Ensure images cover the area without distortion */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#modalRecordImages img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Messages (e.g., for login) */
.message {
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}
.message.error {
    background-color: #fddfe2; /* Lighter red */
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}
.message.success {
    background-color: #d4edda;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* REMOVE OLD ADMIN PANEL RIGHT SIDEBAR STYLES */
/* .admin-body-flex-container, .admin-main-content, .admin-sidebar, .sidebar-section (if exclusively for old right sidebar) */
/* The .sidebar-section class might be reused for styling within new views, so review its usage. */
/* For now, we assume .admin-body-flex-container, .admin-main-content (as specific layout), .admin-sidebar (right) are removed. */
/* If .sidebar-section was generic, its styles might still apply or need adjustment. */

/* NEW ADMIN PANEL LAYOUT WITH LEFT NAVIGATION */
.admin-panel-container {
    display: flex;
    flex-grow: 1; /* Takes available vertical space if body is flex column */
    min-height: calc(100vh - 150px); /* Adjust based on header/footer height */
}

.admin-left-nav {
    width: 220px;
    min-width: 200px;
    background-color: #e9ecef; /* Light grey for nav */
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
}

.admin-left-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-left-nav ul li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--dark-text);
    border-bottom: 1px solid #ddd; /* Separator for links */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-left-nav ul li a:hover {
    background-color: var(--medium-gray);
    color: var(--metallic-blue-darker);
}

.admin-left-nav ul li a.active {
    background-color: var(--metallic-blue);
    color: var(--light-text);
    font-weight: 600;
}

.admin-content-wrapper {
    flex-grow: 1;
    padding: 25px;
    background-color: var(--light-text); /* Ensure content area has a background */
}

.admin-view {
    display: none; /* Hidden by default */
    animation: fadeInView 0.5s ease-in-out;
}

.admin-view.active-view {
    display: block; /* Shown when active */
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Styling for sections within views if using .sidebar-section class */
.admin-view .sidebar-section {
    background-color: var(--light-gray-bg); /* Example: slightly different bg for these sections */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.admin-view .sidebar-section h3, .admin-view .sidebar-section h4 {
    color: var(--metallic-blue-darker);
    margin-top: 0;
}
.admin-view h2 { /* Styles for the main h2 of each view */
    color: var(--metallic-blue-darker);
    text-align: left; /* Align to left, not center as before for main h2 */
    margin-bottom: 20px;
    font-size: 1.8rem; /* Slightly smaller for view titles */
    border-bottom: 2px solid var(--metallic-blue);
    padding-bottom: 10px;
}

/* Styles for User Management Section */
.add-user-section form div {
    margin-bottom: 15px; /* Slightly less margin for form groups */
}

.add-user-section label {
    font-weight: 500; /* Slightly lighter label */
}

#adminUsersTable {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
}

#adminUsersTable th, #adminUsersTable td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
}

#adminUsersTable th {
    background-color: var(--medium-gray);
    color: var(--dark-text);
    font-weight: 600;
}

#adminUsersTable tr:nth-child(even) {
    background-color: var(--light-gray-bg);
}

#adminUsersTable .action-button {
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-right: 5px; /* Space between buttons if multiple */
}

#adminUsersTable .delete-user-button {
    background-color: var(--danger-color);
    color: var(--light-text);
}

#adminUsersTable .delete-user-button:hover {
    background-color: #c82333; /* Darker red */
}

/* Warning Modal Specific Styles */
.warning-modal-content {
    border-left: 5px solid var(--danger-color);
}

.warning-modal-content h4 {
    color: var(--danger-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.warning-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.warning-modal-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.warning-modal-content .irreversible-warning {
    font-weight: bold;
    color: var(--danger-color);
    background-color: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.action-button.secondary-action-button {
    background-color: var(--medium-gray);
    color: var(--dark-text);
}

.action-button.secondary-action-button:hover {
    background-color: #a9b8c9;
}

.message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ensure certain elements are hidden by default */
#clearLogsContainer {
    display: none !important;
}

#logs-view.active-view #clearLogsContainer {
    display: block !important;
}

/* Ensure only active views are shown */
.admin-view {
    display: none !important;
}

.admin-view.active-view {
    display: block !important;
}

footer {
    text-align: center;
    padding: 25px;
    background: var(--metallic-blue-darker);
    color: var(--light-text);
    margin-top: auto; /* Pushes footer to bottom with flexbox */
    font-size: 0.9rem;
}

/* Responsive adjustments if needed */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    header nav a {
        padding: 0.6rem 1rem;
    }

    .admin-panel-controls {
        flex-direction: column;
        align-items: stretch; /* Make controls full width on small screens */
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
    }

    #modalRecordImages img {
        max-width: 120px;
        max-height: 120px;
    }
}

/* Login Page Specific Styles */
.login-page {
    background: linear-gradient(135deg, var(--metallic-blue) 0%, var(--metallic-blue-darker) 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0; /* Ensure no default body margin */
    padding: 0; /* Ensure no default body padding */
}

.login-page-header {
    width: 100%;
    background: transparent;
    color: var(--light-text);
    padding: 1.5rem 20px; /* Add horizontal padding */
    text-align: center;
    box-sizing: border-box;
    border-bottom: none; /* Ensure no border from general header styles if any */
}

.login-page-header h1 {
    margin: 0;
    font-size: 1.8rem; /* Adjusted for a more subtle header on login */
    font-weight: 500;
}

.login-page-main-content {
    flex-grow: 1; /* Takes up available space */
    display: flex;
    justify-content: center; /* Centers login-container horizontally */
    align-items: center; /* Centers login-container vertically */
    width: 100%;
    padding: 20px; /* Padding around the login-container area */
    box-sizing: border-box;
}

/* Remove old styles that might conflict */
/* .login-page .container was here, no longer needed due to .login-page-main-content */

.login-container {
    background-color: var(--light-text);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    max-width: 420px; /* Slightly adjusted max-width */
    box-sizing: border-box;
}

.login-container h2 {
    color: var(--metallic-blue-darker);
    margin-bottom: 25px;
    font-size: 1.6rem; /* Adjusted for consistency */
    font-weight: 600;
}

.login-container form div {
    margin-bottom: 20px;
    text-align: left;
}

.login-container form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.login-container form input[type="text"],
.login-container form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
}

.login-container form input[type="text"]:focus,
.login-container form input[type="password"]:focus {
    border-color: var(--metallic-blue);
    box-shadow: 0 0 0 0.2rem rgba(10, 74, 143, 0.2);
    outline: none;
}

.login-container .remember-me-container {
    display: flex;
    align-items: center;
    text-align: left;
    margin-bottom: 25px;
}

.login-container .remember-me-container input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    vertical-align: middle;
}

.login-container .remember-me-container label {
    margin-bottom: 0;
    font-weight: normal;
    color: #555;
    font-size: 0.9rem;
}

.login-container button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--metallic-blue), var(--metallic-blue-darker));
    color: var(--light-text);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-container button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--metallic-blue-darker), var(--metallic-blue));
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.login-page-footer {
    width: 100%;
    background: transparent;
    color: var(--light-text);
    padding: 1.5rem 20px; /* Add horizontal padding */
    text-align: center;
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* Remove old absolute positioned header/footer for login page */
/* .login-page footer (old rule) was here */
/* .login-page header (old rule) was here */

/* Estilos para la sección de logs */
#logs-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.logs-table {
    width: 80%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1rem;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.logs-table th, .logs-table td {
    border: 1px solid #ddd;
    padding: 12px;
}

.logs-table th {
    background-color: var(--metallic-blue);
    color: var(--light-text);
    text-transform: uppercase;
    font-weight: bold;
}

.logs-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.logs-table tr:hover {
    background-color: #f1f1f1;
}

.logs-table td {
    word-wrap: break-word;
    max-width: 300px;
}

#manualButton {
    background-color: #0D0E3E; /* Specific color for this button */
    color: var(--light-text); /* Ensure text is light */
    padding: 12px 24px; /* Increased padding for more prominence */
    border: 2px solid var(--light-text); /* Added border */
    border-radius: 8px; /* More rounded corners */
    text-decoration: none;
    font-weight: bold; /* Make text bold */
    text-transform: uppercase; /* Uppercase text */
    transition: transform 0.2s ease-out, background-color 0.2s ease-out, box-shadow 0.2s ease-out; /* Smooth transitions */
    cursor: pointer; /* Pointer cursor on hover */
    display: inline-block; /* Ensure it behaves like a block for padding/margin but stays inline */
}

#manualButton:hover {
    transform: scale(1.05); /* Slightly enlarge button on hover */
    background-color: #0A0B2A; /* Darken background on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow for depth */
}

/* Form Templates Management Styles */
.form-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-template-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background-color: var(--light-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.form-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.form-template-card.inactive {
    opacity: 0.6;
    border-color: var(--danger-color);
}

.form-template-card h5 {
    margin: 0 0 10px 0;
    color: var(--metallic-blue);
    font-size: 1.2em;
}

.form-template-card p {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--dark-text);
}

.form-template-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.form-template-actions .action-button {
    flex: 1;
    min-width: 80px;
    font-size: 0.85em;
    padding: 8px 12px;
}

/* Form Template Editor Styles */
.form-template-editor {
    max-height: 70vh;
    overflow-y: auto;
}

.form-section {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #FAFAFA;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: var(--metallic-blue);
    border-bottom: 2px solid var(--metallic-blue);
    padding-bottom: 8px;
}

.form-section h5 {
    margin: 15px 0 10px 0;
    color: var(--metallic-blue-darker);
}

.add-step-section {
    background-color: #F0F8FF;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.steps-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
}

.step-item {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--light-text);
}

.step-item.inactive {
    opacity: 0.6;
    background-color: #F8F8F8;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.step-header h6 {
    margin: 0;
    color: var(--metallic-blue);
    font-size: 1em;
}

.step-actions {
    display: flex;
    gap: 8px;
}

.step-actions .action-button.small {
    padding: 5px 10px;
    font-size: 0.8em;
    min-width: 60px;
}

.step-item p {
    margin: 5px 0;
    font-size: 0.9em;
}

.step-item img {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Form styling for form templates */
.form-section form {
    display: grid;
    gap: 15px;
}

.form-section form div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-section form label {
    font-weight: 600;
    color: var(--dark-text);
}

.form-section form input,
.form-section form textarea,
.form-section form select {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-section form input:focus,
.form-section form textarea:focus,
.form-section form select:focus {
    outline: none;
    border-color: var(--metallic-blue);
    box-shadow: 0 0 0 3px rgba(13, 14, 62, 0.1);
}

.form-section form small {
    color: #666;
    font-size: 0.85em;
    margin-top: -5px;
}

.form-section form button {
    justify-self: start;
    min-width: 120px;
}

/* Modal improvements for form templates */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: var(--metallic-blue);
    border-bottom: 2px solid var(--metallic-blue);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Header mobile responsiveness */
    header {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
        gap: 15px;
    }
    
    header img {
        position: static;
        transform: none;
        max-height: 50px;
        margin: 0 auto;
        display: block;
    }
    
    header h1 {
        margin: 0;
        font-size: 1.5em;
        line-height: 1.2;
    }
    
    header nav {
        position: static;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    header nav a {
        padding: 0.4em 0.8em;
        font-size: 0.9em;
    }
    
    /* Container adjustments for mobile */
    .container {
        width: 95%;
        padding: 15px;
        margin: 10px auto;
    }
    
    main h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-templates-grid {
        grid-template-columns: 1fr;
    }
    
    .form-template-actions {
        flex-direction: column;
    }
    
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .step-actions {
        align-self: stretch;
    }
    
    .step-actions .action-button.small {
        flex: 1;
    }
    
    /* Admin panel mobile adjustments */
    .admin-panel-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .empresa-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .empresa-tabs button {
        flex: 1;
        min-width: 120px;
    }
}

/* Additional mobile adjustments for smaller screens */
@media (max-width: 480px) {
    header {
        padding: 0.8rem;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    header img {
        max-height: 40px;
    }
    
    .container {
        width: 98%;
        padding: 10px;
    }
    
    main h2 {
        font-size: 1.3rem;
    }
    
    form input[type="text"],
    form input[type="password"],
    form input[type="file"],
    form input[type="date"],
    form textarea,
    form select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    form button[type="submit"],
    button {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}