/* Nút cộng/trừ cho bảng động */
body[data-page='home'] #add-record-btn {
    display: block;
}
.table-btn {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    margin: 2px;
    cursor: pointer;
    transition: background 0.2s;
}
.table-btn:hover {
    background: #bae6fd;
}
#app {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-page='login'] #app {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
}

/* Layout chung */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 1rem;
    box-shadow: 2px 0 8px rgba(0,0,0,0.03);
}

.sidebar h3 {
    margin-top: 0;
    color: #0284c7;
    font-size: 1.2rem;
}

.procedure-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.procedure-list li {
    margin-bottom: 0.5rem;
}

.procedure-list .child {
    margin-left: 1.5rem;
    color: #666;
}

.content {
    flex: 1;
    padding: 2rem 2vw;
}

.content h2 {
    margin-top: 0;
    color: #0284c7;
}

.dossiers-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.dossiers-table th, .dossiers-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.dossiers-table th {
    background: #f1f5f9;
    color: #333;
    height: 30px;
}

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

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination button {
    background: #fff;
    border: 1px solid #0ea5e9;
    color: #0ea5e9;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.pagination button.active, .pagination button:hover {
    background: #0ea5e9;
    color: #fff;
}

/* Login form chung */
.login-container {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    max-width: 350px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-container h2 {
    margin: 0 0 1rem 0;
    text-align: center;
    color: #0ea5e9;
}

.login-container input {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}

.login-container input:focus {
    border: 1.5px solid #0ea5e9;
}

.login-container button {
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-container button:hover {
    background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
}

.login-container .error {
    color: #e53e3e;
    text-align: center;
    font-size: 0.95rem;
}

/* Modern home page styles */
.modern-home {
    background: linear-gradient(120deg, #f0f9ff 60%, #bae6fd 100%);
}

.modern-sidebar {
    background: #fff;
    border-radius: 1.2rem;
    margin: 2rem 1rem 2rem 2rem;
    box-shadow: 0 4px 24px 0 rgba(80, 112, 255, 0.08);
    min-width: 250px;
    max-width: 320px;
    padding: 2rem 1.2rem;
}

.modern-sidebar h3 {
    font-size: 1.3rem;
    color: #0ea5e9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.procedure-list li {
    padding: 0.5rem 1rem;
    border-radius: 0.7rem;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.procedure-list li.parent {
    font-weight: bold;
    color: #0ea5e9;
}

.procedure-list li.child {
    margin-left: 1.5rem;
    color: #0284c7;
    font-weight: 500;
    font-size: 13px;
}

.procedure-list li {
    font-size: 15px;
}

.procedure-list li.active-parent {
    background: #0ea5e9 !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(80, 112, 255, 0.10);
}

.procedure-list li.active-child {
    background: #bae6fd !important;
    color: #0369a1 !important;
    font-weight: 600;
}

.toggle-icon {
    font-size: 1.35rem;
    margin-right: 0.7rem;
    font-weight: 900;
    user-select: none;
    display: inline-block;
    vertical-align: middle;
    transition: color 0.2s;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.content-header h2 {
    color: #0ea5e9;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-record-btn {
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    padding: 0.6rem 1.3rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(80, 112, 255, 0.08);
    transition: background 0.2s, box-shadow 0.2s;
}

.add-record-btn:hover {
    background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
    box-shadow: 0 4px 16px rgba(80, 112, 255, 0.15);
}

.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.06);
}

.modern-table {
    min-width: 600px;
    border-radius: 1.2rem;
    overflow: hidden;
}

.modern-table th, .modern-table td {
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    text-align: center;
}

.modern-table th {
    background: #bae6fd;
    color: #0369a1;
    font-weight: 700;
}

.modern-table tr {
    transition: background 0.2s;
}

.modern-table tr:hover {
    background: #e0f2fe;
}

.modern-pagination {
    margin-top: 1.5rem;
}

.modern-pagination button {
    border-radius: 0.5rem;
    border: 1.5px solid #0ea5e9;
    color: #0ea5e9;
    background: #fff;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.modern-pagination button.active, .modern-pagination button:hover {
    background: #0ea5e9;
    color: #fff;
}

h2 {
    text-align: center;
    margin-bottom: 16px;
    color: #0284c7;
    letter-spacing: 1px;
    font-size: 2rem;
}

.hide {
    display: none;
}

/* Timeline gốc */
#timeline {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 32px;
    padding: 24px 10px 10px 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1.2rem;
    box-shadow: 0 2px 16px 0 rgba(14, 165, 233, 0.08);
    margin: 0 auto 24px auto;
    max-width: 70vw;
    min-height: 90px;
    transition: box-shadow 0.2s;
}

/* Step style */
.step {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    text-align: center;
    background: none;
    border: none;
    outline: none;
}

.step-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    border: 3px solid #bae6fd;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.10);
}

.step.active .step-circle {
    border: 3.5px solid #0ea5e9;
    box-shadow: 0 0 0 8px #bae6fd, 0 6px 24px rgba(14, 165, 233, 0.25);
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.step-title {
    font-size: 1rem;
    color: #0284c7;
    font-weight: 600;
}

.step.active .step-title {
    color: #0ea5e9;
    font-weight: 700;
    text-shadow: 0 2px 10px #bae6fd, 0 0 2px #0ea5e9;
}

.arrow {
    flex: 0 0 auto;
    color: #0ea5e9;
    font-weight: bold;
    font-size: 2rem;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.details {
    margin: 36px auto 0 auto;
    padding: 28px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.10);
    min-height: 100px;
    max-width: 50%;
    animation: fadeIn 0.4s ease;
}

.details h3 {
    margin: 0 0 8px 0;
    color: #0ea5e9;
    font-size: 1.2rem;
}

.details p {
    margin: 0;
    color: #0369a1;
    font-size: 1.05rem;
}

.mobile-sidebar-toggle {
    width: 15px;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: #0ea5e9;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
    cursor: pointer;
    display: none;
}
.sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 16px rgba(14, 165, 233, 0.12);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.2s;
}

.action-btn {
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(80, 112, 255, 0.08);
}
.action-btn:hover {
    background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
    box-shadow: 0 4px 16px rgba(80, 112, 255, 0.15);
}

.action-btn-disabled {
    background: #e0f2fe;
    color: #7dd3fc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Spinner styles */
.spinner-svg {
    vertical-align: middle;
    margin-right: 0.4em;
    animation: spinner-rotate 0.9s linear infinite;
    display: inline-block;
}
.spinner-bg {
    stroke: #bae6fd;
    opacity: 0.5;
}
.spinner-fg {
    stroke: #0ea5e9;
    stroke-linecap: round;
    animation: spinner-dash 1.2s ease-in-out infinite;
}
@keyframes spinner-rotate {
    100% { transform: rotate(360deg); }
}
@keyframes spinner-dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 60; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 60; stroke-dashoffset: -124; }
}
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

#global-spinner {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}
.global-spinner-backdrop {
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.18);
    z-index: 1;
}
.global-spinner-svg {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 1.2em;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.13);
    padding: 2.2em;
}
#global-spinner .spinner-svg {
    width: 3.5em;
    height: 3.5em;
    margin: 0;
    animation: spinner-rotate 0.9s linear infinite;
}

.record-detail-container {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.10);
    padding: 2.5rem 3.5rem 2.5rem 3.5rem;
}

.record-info {
    margin-bottom: 2rem;
    background: #e0f2fe;
    border-radius: 0.7rem;
    padding: 1.2rem 2.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: flex-start;
}
.info-row {
    margin-bottom: 0.5rem;
    min-width: 220px;
}
.info-label {
    color: #0284c7;
    font-weight: 600;
    min-width: 110px;
    display: inline-block;
}
.record-form {
    margin-bottom: 2rem;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.form-row {
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    flex: 1 1 260px;
}
.form-row label {
    font-weight: 500;
    color: #0369a1;
    margin-bottom: 0.3rem;
}
.form-row input[type="text"],
.form-row input[type="date"],
.form-row textarea {
    padding: 0.6rem 0.9rem;
    border: 1px solid #bae6fd;
    border-radius: 0.6rem;
    outline: none;
    transition: border 0.2s;
}
.form-row textarea {
    min-height: 200px;
    resize: vertical;
}
.form-row input[type="text"]:focus,
.form-row input[type="date"]:focus {
    border: 1.5px solid #0ea5e9;
}

.record-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    margin-top: 2.2rem;
}
.spin-icon {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.2em;
    border: 2.5px solid #bae6fd;
    border-top: 2.5px solid #0ea5e9;
    border-radius: 50%;
    animation: none;
    vertical-align: middle;
}
.spinning {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.18);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    min-width: 260px;
    max-width: 90vw;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.13);
    text-align: center;
}
.modal-actions {
    margin-top: 1.2rem;
    display: flex;
    gap: 1.2rem;
    justify-content: center;
}
.modal-content .close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 1.5em;
    color: #888;
    transition: color 0.2s;
}
#modern-content .record-detail-container {
    width: 100%;
    max-width: unset;
    min-width: unset;
    box-sizing: border-box;
}
#modern-content .record-info {
    display: block;
    padding: 1.2rem 2.2rem;
    gap: 0;
}
#modern-content .info-row {
    min-width: unset;
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
}
#modern-content .info-label {
    min-width: 110px;
    margin-right: 0.7rem;
}
#modern-content .record-form {
    flex-direction: column;
    gap: 1.1rem;
    flex-wrap: nowrap;
    align-items: stretch;
}
#modern-content .form-row {
    min-width: unset;
    flex: unset;
}
#modern-content .record-actions {
    justify-content: flex-start;
    gap: 1.2rem;
    flex-direction: row !important;
    align-items: center;
    margin-top: 1.5rem;
}

.li-counter {
    position: absolute;
    right: 1.2em;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    color: #0284c7;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 1em;
    padding: 0.1em 0.7em;
    min-width: 1.8em;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(14,165,233,0.08);
}
.parent.procedure-parent {
    position: relative;
}

/* Style cho phần file */
#record-files {
    margin-bottom: 1.5rem;
}
.record-file {
    border: 1px solid #bae6fd;
    border-radius: 0.7rem;
    margin-bottom: 0.7rem;
    background: #f0f9ff;
}
.record-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: #0369a1;
}
.file-toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.record-file-form {
    padding: 1rem 1.2rem 1.2rem 1.2rem;
    background: #fff;
    border-top: 1px solid #bae6fd;
    border-radius: 0 0 0.7rem 0.7rem;
}

.legend-label {
    font-weight: bold;
    font-size: 20px;
}

/* Select trong form động */
.form-row select {
    padding: 0.6rem 1rem;
    border: 1px solid #bae6fd;
    border-radius: 0.6rem;
    font-size: 1rem;
    background: #fff;
    color: #0369a1;
    outline: none;
    transition: border 0.2s;
}
.form-row select:focus {
    border: 1.5px solid #0ea5e9;
}

/* Bảng động trong form */
.dynamic-table {
    width: 100%;
    max-width: 100%;   /* 🚀 không vượt quá cha */
    border-collapse: collapse;
    background: #f8fafc;
    border-radius: 0.7rem;
    table-layout: fixed; /* ép cột chia đều, không bị giãn vô hạn */
    margin-top: 0.5rem;
    word-wrap: break-word;
}

.dynamic-table th, .dynamic-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid #bae6fd;
    font-size: 1rem;
    text-align: left;
}
.dynamic-table th {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 600;
    text-align: center;
}
.dynamic-table input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.dynamic-table tr:last-child td {
    border-bottom: 1px solid #bae6fd;
}

#modal-preview {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.15);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#preview-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
#preview-actions {
    margin-top: 18px;
    text-align: right;
}

/* Responsive cho bảng động */
@media (max-width: 700px) {
    .dynamic-table th, .dynamic-table td {
        font-size: 0.95rem;
        padding: 0.4rem 0.3rem;
    }
}

@media (max-width: 900px) {
    .modern-home, .main-layout {
        flex-direction: column;
        padding: 5px;
    }
    .modern-sidebar {
        margin: 1rem;
        min-width: unset;
        max-width: unset;
    }
    .modern-content {
        padding: 1.2rem 2vw;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .content-header h2 {
        font-size: 1.1rem;
    }
    .add-record-btn {
        font-size: 0.95rem;
        padding: 0.5rem 0.8rem;
    }
    .record-detail-container {
        padding: 1.5rem 0.7rem 1.5rem 0.7rem;
        max-width: 99vw;
    }
}

@media (max-width: 700px) {
    .main-layout, .modern-home {
        flex-direction: column;
    }
    .sidebar, .modern-sidebar {
        width: 100%;
        min-width: unset;
        max-width: unset;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.7rem 0.5rem;
        margin: 0.5rem;
    }
    .content, .modern-content {
        padding: 0.7rem 1vw;
    }
    .content-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    .dossiers-table th, .dossiers-table td {
        font-size: 0.95rem;
        padding: 0.5rem 0.4rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .dossiers-table, .modern-table {
        min-width: 600px;
    }
}

@media (max-width: 600px) {
    .modern-sidebar {
        padding: 1rem 0.5rem;
        margin: 0.5rem;
    }
    .modern-content {
        padding: 0.5rem 1vw;
    }
    .modern-table th, .modern-table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.95rem;
        text-align: center;
    }
    .modern-table th:first-child, .modern-table td:first-child {
        width: 30%;
    }
    .add-record-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.95rem;
    }
    .login-container {
        padding: 2rem 1rem;
        max-width: 95vw;
    }    
    .mobile-sidebar-toggle { 
        display: block; 
    }
    .sidebar { 
        display: none; 
    }
    .sidebar.sidebar-mobile { 
        display: block;
        margin-top: 50px;
    }
    .modern-table, .dossiers-table {
        min-width: unset !important;
        width: 100% !important;
        table-layout: fixed;
    }
    .modern-table th, .modern-table td,
    .dossiers-table th, .dossiers-table td {
        font-size: 0.98rem;
        padding: 0.5rem 0.3rem;
        text-align: left;
        word-break: break-word;
        white-space: normal;
    }
    /* Chỉ ẩn các cột từ thứ 3 đến cột áp chót, giữ lại cột Xem cuối cùng */
    .dossiers-table th:nth-child(n+3):not(:last-child),
    .dossiers-table td:nth-child(n+3):not(:last-child) {
        display: none !important;
    }
    .modern-table th:nth-child(n+3):not(:last-child),
    .modern-table td:nth-child(n+3):not(:last-child) {
        display: none !important;
    }
    #timeline {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        border-radius: 0 0 12px 12px;
        min-width: 0;
    }
    .step {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 12px;
        border-bottom: 1px solid #bae6fd;
        margin: 0;
    }
    .step:last-child {
        border-bottom: none;
    }
    .step-circle {
        margin: 0 12px 0 0;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .step-title {
        text-align: left;
        font-size: 1rem;
    }
    .arrow {
        display: none;
    }
    .details-inline {
        max-width: 100%;
        margin: 12px 0 12px 0;
        border-radius: 8px;
        box-shadow: none;
        padding: 16px 12px;
    }
    .details {
        max-width: 100%;
        margin: 12px;
        border-radius: 8px;
        box-shadow: none;
    }
    .record-detail-container {
        max-width: 99vw;
        padding: 1.1rem 0.3rem 1.2rem 0.3rem;
    }
    .record-info {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .record-actions {
        flex-direction: row !important;
        justify-content: flex-start;
        gap: 0.7rem;
        align-items: center;
    }
    .action-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.7rem;
    }
    .modal-content {
        padding: 1.2rem 0.7rem;
    }
    .record-form {
        flex-direction: column;
        gap: 0.7rem;
    }
    .form-row {
        min-width: unset;
    }
}

@media (max-width: 500px) {
    .content-header h2 {
        font-size: 1rem;
    }
    .add-record-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
    .dossiers-table th, .dossiers-table td {
        font-size: 0.9rem;
        padding: 0.35rem 0.2rem;
        text-align: center;
    }
    .sidebar h3 {
        font-size: 1rem;
    }
}

