/**
 * GPS-Service - Panel Web de Administración
 * Main Stylesheet
 */

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales - Inspirados en Stripe */
    --primary-color: #635bff;
    --primary-dark: #0a2540;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f6f9fc;
    --dark-color: #0a2540;
    --border-color: #e7ecf1;

    /* Sombras modernas - Estilo Stripe */
    --shadow-xs: 0 1px 2px rgba(50, 50, 93, 0.1);
    --shadow-sm: 0 2px 5px rgba(50, 50, 93, 0.1);
    --shadow: 0 4px 12px rgba(50, 50, 93, 0.12);
    --shadow-md: 0 8px 20px rgba(50, 50, 93, 0.15);
    --shadow-lg: 0 15px 35px rgba(50, 50, 93, 0.18);
    --shadow-xl: 0 25px 50px -12px rgba(50, 50, 93, 0.25);

    /* Border radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing: 16px;
    --spacing-md: 20px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    letter-spacing: 0.2px;
}

/* ========== LAYOUT ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { width: 8.33%; padding: 0 15px; }
.col-2 { width: 16.66%; padding: 0 15px; }
.col-3 { width: 25%; padding: 0 15px; }
.col-4 { width: 33.33%; padding: 0 15px; }
.col-6 { width: 50%; padding: 0 15px; }
.col-8 { width: 66.66%; padding: 0 15px; }
.col-12 { width: 100%; padding: 0 15px; }

/* ========== NAVIGATION ========== */
.navbar {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    position: relative;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.navbar-brand img {
    height: 55px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

.navbar-brand.text-only {
    /* Fallback if logo is not available */
}

/* Login logo */
.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 80px;
    width: auto;
    max-width: 300px;
}

.navbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #666;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.navbar-menu a {
    text-decoration: none;
    color: #333;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background-color: var(--light-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 250px;
    background-color: #fff;
    height: calc(100vh - 66px);
    position: fixed;
    left: 0;
    top: 66px;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--light-color);
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
}

/* Sidebar logo */
.sidebar .logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar .logo h2 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar .logo p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
}

/* Sidebar navigation */
.sidebar .nav {
    padding: 20px 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--light-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar .nav-link span {
    margin-right: 10px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Sidebar section dividers */
.nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 20px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 66px);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.page-header p {
    color: var(--secondary-color);
}

/* ========== CARDS ========== */
.card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background-color: var(--light-color);
}

/* Stat Cards */
.stat-card {
    padding: var(--spacing-lg);
    text-align: center;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-icon {
    font-size: 48px;
    opacity: 0.2;
    margin-bottom: 10px;
}

/* ========== TABLES ========== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--light-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--dark-color);
}

table th:first-child {
    border-top-left-radius: var(--radius-lg);
}

table th:last-child {
    border-top-right-radius: var(--radius-lg);
}

table tr {
    transition: background-color 0.2s ease;
}

table tr:hover {
    background-color: #f8f9fa;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: inherit;
    color: var(--dark-color);
    background-color: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1), var(--shadow-sm);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1), var(--shadow-sm);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%230a2540' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
    box-shadow: var(--shadow-xs);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5347db;
}

.btn-secondary {
    background-color: #fff;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f6f9fc;
    border-color: #cbd5e1;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #333;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: var(--radius-lg);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 17px;
    border-radius: var(--radius-xl);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: inline-flex;
    gap: 5px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: var(--radius);
    color: #fff;
    box-shadow: var(--shadow-xs);
    background-color: var(--secondary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-info {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

/* ========== ALERTS ========== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-xs);
    font-size: 14px;
    line-height: 1.6;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ========== MODALS ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 37, 64, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    max-width: 360px;
}

.toast {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(8px);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background-color: var(--success-color);
}

.toast-error {
    background-color: var(--danger-color);
}

.toast-warning {
    background-color: var(--warning-color);
    color: #333;
}

.toast-info {
    background-color: var(--info-color);
}

/* ========== LOADING OVERLAY ========== */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 4000;
    align-items: center;
    justify-content: center;
}

#loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 91, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--secondary-color); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ========== RESPONSIVE ========== */
/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 15px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Show hamburger menu */
    .menu-toggle {
        display: block;
    }

    /* Hide sidebar by default */
    .sidebar {
        transform: translateX(-250px);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    /* Show sidebar when open */
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    /* Adjust main content */
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }

    /* Stack columns */
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Adjust navbar */
    .navbar-title {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .navbar-user span {
        display: none;
    }

    .navbar-user {
        gap: 8px;
    }

    /* Hide some elements on mobile */
    .navbar-menu {
        display: none;
    }

    /* Card spacing */
    .card {
        margin-bottom: 15px;
    }

    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Button groups */
    .d-flex.justify-between {
        flex-direction: column;
        gap: 15px;
    }

    .d-flex.justify-between > div {
        width: 100%;
    }

    .d-flex.justify-between .btn {
        width: 100%;
    }

    /* Page header */
    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

    /* Stat cards */
    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 28px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    /* Forms */
    .form-group label {
        font-size: 14px;
    }

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ============================================
   RECORD DETAIL PAGE STYLES
   ============================================ */

.detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.detail-item span,
.detail-item a {
    color: #333;
    font-size: 1rem;
}

.detail-item a {
    color: #2563eb;
    text-decoration: none;
}

.detail-item a:hover {
    text-decoration: underline;
}

.detail-item-full {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.detail-item-full label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.observations-text,
.rejection-text {
    margin: 0;
    padding: 1rem;
    background: #f9fafb;
    border-left: 4px solid #2563eb;
    border-radius: 4px;
    line-height: 1.6;
}

.rejection-text {
    border-left-color: #dc2626;
    background: #fef2f2;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.image-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-caption {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    background: white;
}

/* Signatures Grid */
.signatures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.signature-item {
    text-align: center;
}

.signature-item label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 1rem;
}

.signature-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

/* Image Modal */
.modal-large {
    max-width: 90vw;
    max-height: 90vh;
}

.modal-large .modal-body {
    max-height: 70vh;
    overflow: auto;
}

.modal-large .modal-body img {
    display: block;
    margin: 0 auto;
}

/* Loading and Error States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
    text-align: center;
}

.error-state p {
    color: #dc2626;
    font-size: 1.125rem;
}

/* Responsive adjustments for detail page */
@media (max-width: 768px) {
    .detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons-right {
        justify-content: center;
    }

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

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

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

/* ========== FORM GRID (HORIZONTAL FILTERS) ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-grid.filters-compact {
    grid-template-columns: 1fr 1fr 1fr 0.8fr 0.8fr auto;
    gap: 12px;
}

@media (max-width: 1200px) {
    .form-grid.filters-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .form-grid,
    .form-grid.filters-compact {
        grid-template-columns: 1fr;
    }
}
