/* ========================================
   CERTIFICATE FORMS SHARED STYLESHEET
   Version: 1.0
   Used by: certificate_of_birth.php, certificate_of_marriage.php, certificate_of_death.php
   ======================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --sidebar-bg: #051f3a;
    --sidebar-item-hover: rgba(59, 130, 246, 0.1);
    --sidebar-item-active: rgba(59, 130, 246, 0.2);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --primary-color: #0d6efd;
    --danger-color: #dc3545;
    --success-color: #198754;
    --warning-color: #ffc107;
    --secondary-color: #6c757d;
    --dark-blue: #1e3a5f;
    --border-color: #dee2e6;
    --text-color: #495057;
    --light-bg: #f8f9fa;
}

/* ========================================
   GLOBAL RESETS
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    line-height: 1.5;
    color: #212529;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* ========================================
   MOBILE HEADER
   ======================================== */
.mobile-header {
    display: none;
    background: var(--sidebar-bg);
    color: var(--text-primary);
    padding: 16px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.mobile-header h4 [data-lucide] {
    color: var(--accent-color);
    margin-right: 10px;
}

#mobileSidebarToggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#mobileSidebarToggle:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.05);
}

/* ========================================
   SIDEBAR OVERLAY
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

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

/* ========================================
   TOP NAVBAR (DESKTOP)
   ======================================== */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 100;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .top-navbar {
    left: var(--sidebar-collapsed-width);
}

#sidebarCollapse {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #374151;
    cursor: pointer;
    padding: 10px;
    margin-left: 20px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebarCollapse:hover {
    background: #f3f4f6;
    color: var(--accent-color);
    transform: scale(1.05);
}

.top-navbar-info {
    margin-left: 16px;
}

.welcome-text {
    color: #6b7280;
    font-size: 13.5px;
    font-weight: 500;
}

/* ========================================
   USER PROFILE DROPDOWN
   ======================================== */
.user-profile-dropdown {
    margin-left: auto;
    margin-right: 20px;
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.user-profile-btn:active,
.user-profile-btn.active {
    background: #f3f4f6;
    border-color: var(--accent-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.user-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.user-profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.user-role {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.3;
    text-transform: capitalize;
}

.dropdown-arrow {
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.user-profile-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 20px;
}

.dropdown-user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dropdown-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.dropdown-user-email {
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 8px;
}

.dropdown-user-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 6px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
    background: #f9fafb;
    color: #111827;
    padding-left: 24px;
}

.dropdown-item.logout-item {
    color: #dc2626;
}

.dropdown-item.logout-item:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--text-primary);
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    min-height: 64px;
    display: flex;
    align-items: center;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-header h4 [data-lucide] {
    min-width: 28px;
    color: var(--accent-color);
}

.sidebar-collapsed .sidebar-header h4 span {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 4px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    gap: 12px;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-item-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}

.sidebar-menu li a.active {
    background: var(--sidebar-item-active);
    color: #b7ff9a;
    font-weight: 600;
    animation: menuItemActivate 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuItemActivate {
    0% { background: transparent; transform: translateX(-4px); }
    60% { transform: translateX(5px); }
    100% { background: var(--sidebar-item-active); transform: translateX(0); }
}

.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    background: var(--accent-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.sidebar-menu li a [data-lucide] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover [data-lucide] {
    transform: scale(1.1);
}

.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 14px 10px;
}

.sidebar-collapsed .sidebar-menu li a span {
    display: none;
}

.sidebar-collapsed .sidebar-menu li a.active::before {
    left: -10px;
}

.sidebar-divider {
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    margin: 18px 16px;
}

.sidebar-heading {
    padding: 18px 20px 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.sidebar-collapsed .sidebar-heading {
    text-indent: -9999px;
    padding: 8px 0;
}

/* Tooltips for collapsed sidebar */
.sidebar-collapsed .sidebar-menu li a::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
    margin-left: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sidebar-collapsed .sidebar-menu li a:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.content {
    margin-left: var(--sidebar-width);
    padding: 0;
    padding-top: 64px;
    min-height: 100vh;
    background: #f5f5f5;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
}

.main-content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    background: #ffffff;
    min-height: calc(100vh - 64px);
}

.form-content-container {
    padding: 0;
}

/* ========================================
   HEADER WITH LOGO
   ======================================== */
.system-header {
    background: #1e3a5f;
    padding: clamp(12px, 2vw, 16px) clamp(15px, 2.5vw, 20px);
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 16px);
    border-bottom: 4px solid #0d6efd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.system-logo {
    width: clamp(60px, 9vw, 80px);
    height: clamp(60px, 9vw, 80px);
    border-radius: 12px;
    background-color: transparent;
    padding: clamp(8px, 1.2vw, 12px);
    box-shadow: none;
    flex-shrink: 0;
    border: none;
}

.system-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.system-title-container {
    flex: 1;
}

.system-title {
    font-size: clamp(1.1rem, 2.3vw, 1.4rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.system-subtitle {
    font-size: clamp(0.75rem, 1.4vw, 0.875rem);
    color: rgba(255, 255, 255, 0.85);
    margin-top: clamp(4px, 0.6vw, 6px);
    font-weight: 500;
}

.page-header {
    text-align: center;
    margin: 0;
    padding: clamp(20px, 3vw, 28px) clamp(16px, 2.5vw, 20px);
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    color: #212529;
    margin-bottom: clamp(4px, 0.8vw, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.2vw, 10px);
}

.page-subtitle {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: #6c757d;
    font-weight: 400;
}

/* ========================================
   TWO COLUMN LAYOUT
   ======================================== */
.form-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(16px, 2.5vw, 24px);
    margin: 0;
    padding: clamp(20px, 3vw, 32px) clamp(16px, 2.5vw, 24px);
}

@media (max-width: 1024px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
}

.form-column {
    background-color: #ffffff;
}

.pdf-column {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: clamp(4px, 0.8vw, 6px);
    padding: clamp(12px, 2vw, 16px);
    position: sticky;
    top: clamp(8px, 1.5vw, 12px);
    height: fit-content;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.pdf-column.hidden {
    display: none;
}

.form-layout.pdf-hidden {
    grid-template-columns: 1fr;
}

/* ========================================
   FORM SECTIONS
   ======================================== */
.form-section {
    margin-bottom: clamp(20px, 3vw, 28px);
}

.section-header {
    background-color: #f8f9fa;
    border-left: 3px solid #0d6efd;
    padding: clamp(8px, 1.5vw, 12px) clamp(10px, 1.8vw, 14px);
    margin-bottom: clamp(12px, 2vw, 16px);
    border-radius: clamp(3px, 0.6vw, 4px);
}

.section-title {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 8px);
}

.section-title svg {
    width: clamp(16px, 2vw, 18px);
    height: clamp(16px, 2vw, 18px);
    stroke: #0d6efd;
}

/* ========================================
   FORM GROUPS & INPUTS
   ======================================== */
.form-group {
    margin-bottom: clamp(14px, 2.2vw, 18px);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 25vw, 180px), 1fr));
    gap: clamp(12px, 2vw, 16px);
    margin-bottom: clamp(12px, 2vw, 16px);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: clamp(6px, 1vw, 8px);
    font-size: clamp(0.75rem, 1.4vw, 0.8125rem);
}

label .required {
    color: #dc3545;
    margin-left: 2px;
    font-weight: 600;
}

/* Accessibility: Screen reader only text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: clamp(6px, 1.2vw, 8px) clamp(10px, 1.6vw, 12px);
    border: 1px solid #ced4da;
    border-radius: clamp(3px, 0.6vw, 4px);
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    font-family: inherit;
    background: #ffffff;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Validation states */
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: #dc3545;
}

input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

input.is-valid,
select.is-valid,
textarea.is-valid {
    border-color: #198754;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 4px;
}

input.is-invalid ~ .invalid-feedback,
select.is-invalid ~ .invalid-feedback,
textarea.is-invalid ~ .invalid-feedback {
    display: block;
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: clamp(60px, 12vw, 80px);
}

input[type="datetime-local"] {
    width: 100%;
    padding: clamp(7px, 1.3vw, 9px) clamp(9px, 1.5vw, 11px);
    border: 1px solid #ced4da;
    border-radius: clamp(3px, 0.6vw, 4px);
    font-size: clamp(0.75rem, 1.4vw, 0.8125rem);
    font-family: inherit;
    color: #212529;
    background-color: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="datetime-local"]:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

input[type="file"] {
    padding: clamp(6px, 1.2vw, 8px);
    border: 2px dashed #ced4da;
    border-radius: clamp(3px, 0.6vw, 4px);
    width: 100%;
    font-size: clamp(0.7rem, 1.3vw, 0.75rem);
    background-color: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.15s;
}

input[type="file"]:hover {
    border-color: #0d6efd;
}

.help-text {
    display: block;
    font-size: clamp(0.7rem, 1.3vw, 0.75rem);
    color: #8e96a0;
    margin-top: clamp(3px, 0.6vw, 4px);
    font-style: normal;
}

/* ========================================
   BUTTONS
   ======================================== */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(8px, 1.5vw, 12px);
    margin-top: clamp(20px, 3vw, 28px);
    padding: clamp(15px, 2.5vw, 20px);
    background: #f8f9fa;
    border-radius: clamp(4px, 0.8vw, 6px);
    border-top: 2px solid #dee2e6;
}

.sticky-buttons {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding: clamp(15px, 2.5vw, 20px) 0;
    margin-top: clamp(20px, 3vw, 30px);
    z-index: 50;
    border-top: 2px solid #dee2e6;
}

@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(4px, 0.8vw, 6px);
    padding: clamp(8px, 1.5vw, 10px) clamp(14px, 2.2vw, 18px);
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: clamp(4px, 0.8vw, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

@media (max-width: 600px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
}

.btn:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn svg {
    width: clamp(14px, 1.8vw, 16px);
    height: clamp(14px, 1.8vw, 16px);
}

/* Button variants */
.btn-primary {
    background-color: #0d6efd;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-success {
    background-color: #198754;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: #157347;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #bb2d3b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #664d03;
}

.btn-warning:hover:not(:disabled) {
    background-color: #ffca2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner 0.6s linear infinite;
}

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

/* ========================================
   PDF PREVIEW SECTION
   ======================================== */
.pdf-preview-header {
    margin-bottom: clamp(10px, 1.8vw, 12px);
    padding-bottom: clamp(8px, 1.5vw, 10px);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-preview-title {
    font-size: clamp(0.85rem, 1.6vw, 0.95rem);
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: clamp(5px, 1vw, 6px);
}

.pdf-preview-title svg {
    width: clamp(16px, 2vw, 18px);
    height: clamp(16px, 2vw, 18px);
    stroke: #0d6efd;
}

.toggle-pdf-btn {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.toggle-pdf-btn:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    color: #0d6efd;
}

.toggle-pdf-btn svg {
    width: 16px;
    height: 16px;
}

.pdf-column.hidden {
    display: none;
}

.form-layout.pdf-hidden {
    grid-template-columns: 1fr;
}

.floating-toggle-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #0d6efd;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-toggle-btn:hover {
    background: #0b5ed7;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

.floating-toggle-btn.show {
    display: flex;
}

.floating-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.upload-scanner-container {
    display: flex;
    gap: clamp(8px, 1.5vw, 12px);
    align-items: flex-start;
    flex-wrap: wrap;
}

.upload-scanner-container input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.pdf-upload-section {
    margin-bottom: clamp(16px, 2.5vw, 20px);
    background: #f8f9fa;
    padding: clamp(16px, 2.5vw, 20px);
    border-radius: clamp(4px, 0.8vw, 6px);
    border: 1px solid #dee2e6;
}

.pdf-upload-area {
    border: 2px dashed #ced4da;
    border-radius: clamp(4px, 0.8vw, 6px);
    padding: clamp(20px, 3vw, 30px);
    text-align: center;
    background-color: #ffffff;
    transition: all 0.15s;
    cursor: pointer;
    margin-bottom: clamp(10px, 1.8vw, 12px);
}

.pdf-upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.pdf-upload-area svg {
    width: clamp(40px, 6vw, 50px);
    height: clamp(40px, 6vw, 50px);
    stroke: #6c757d;
    margin-bottom: clamp(10px, 2vw, 15px);
}

.pdf-upload-text {
    color: #6c757d;
    font-size: clamp(0.75rem, 1.4vw, 0.8125rem);
    margin-bottom: clamp(6px, 1.2vw, 8px);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.8vw, 14px);
    padding: clamp(12px, 2vw, 14px) clamp(14px, 2.2vw, 16px);
    margin-bottom: clamp(12px, 2vw, 16px);
    border-radius: clamp(4px, 0.8vw, 6px);
    border-left: 3px solid;
    font-size: clamp(0.8rem, 1.5vw, 0.875rem);
    animation: slideIn 0.3s ease-out;
}

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

.alert svg {
    width: clamp(18px, 2.2vw, 20px);
    height: clamp(18px, 2.2vw, 20px);
    flex-shrink: 0;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #198754;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-color: #ffc107;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #0d6efd;
}

/* ========================================
   PDF UPLOAD SECTION
   ======================================== */
.pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(10px, 1.8vw, 14px);
}

.pdf-title {
    font-size: clamp(0.85rem, 1.6vw, 0.95rem);
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 8px);
}

.toggle-pdf-btn {
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    padding: clamp(4px, 0.8vw, 6px);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-pdf-btn:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: clamp(10px, 1.8vw, 14px);
}

.pdf-preview,
.pdf-preview-container {
    margin-top: clamp(10px, 1.8vw, 14px);
    border: 1px solid #dee2e6;
    border-radius: clamp(4px, 0.8vw, 6px);
    overflow: hidden;
    background: #ffffff;
}

.pdf-preview iframe,
.pdf-preview-container iframe {
    width: 100%;
    height: clamp(400px, 50vw, 600px);
    border: none;
}

.pdf-info {
    margin-top: clamp(10px, 1.8vw, 12px);
    padding: clamp(8px, 1.5vw, 10px);
    background-color: #e7f1ff;
    border-left: 3px solid #0d6efd;
    border-radius: clamp(3px, 0.6vw, 4px);
    font-size: clamp(0.7rem, 1.3vw, 0.75rem);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 8px);
}

.pdf-info svg {
    width: clamp(14px, 1.8vw, 16px);
    height: clamp(14px, 1.8vw, 16px);
    stroke: #084298;
    flex-shrink: 0;
}

.pdf-filename {
    font-weight: 600;
    color: #084298;
    word-break: break-all;
}

.pdf-upload-hint {
    color: #adb5bd;
    font-size: clamp(0.7rem, 1.3vw, 0.75rem);
}

@media (max-width: 768px) {
    .pdf-preview iframe,
    .pdf-preview-container iframe {
        height: 250px;
    }
}

.floating-toggle-btn {
    position: fixed;
    bottom: clamp(15px, 2.5vw, 20px);
    right: clamp(15px, 2.5vw, 20px);
    width: clamp(45px, 8vw, 56px);
    height: clamp(45px, 8vw, 56px);
    border-radius: 50%;
    background-color: #0d6efd;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-toggle-btn.show {
    display: flex;
}

.floating-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-toggle-btn svg {
    width: clamp(20px, 3vw, 24px);
    height: clamp(20px, 3vw, 24px);
}

/* ========================================
   SCANNER BUTTON
   ======================================== */
.scanner-btn,
.btn-scan {
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 8px);
    padding: clamp(8px, 1.5vw, 10px) clamp(14px, 2.2vw, 18px);
    font-size: clamp(0.75rem, 1.4vw, 0.875rem);
    font-weight: 500;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border: none;
    border-radius: clamp(4px, 0.8vw, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    white-space: nowrap;
}

.scanner-btn:hover,
.btn-scan:hover {
    background: linear-gradient(135deg, #218838 0%, #1ab886 100%);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

.scanner-btn:active,
.btn-scan:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 167, 69, 0.2);
}

.scanner-btn svg,
.btn-scan svg {
    width: clamp(16px, 2vw, 18px);
    height: clamp(16px, 2vw, 18px);
}

/* Scan Status Messages */
.scan-status {
    margin-top: clamp(8px, 1.5vw, 10px);
    padding: clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 14px);
    border-radius: clamp(4px, 0.8vw, 6px);
    font-size: clamp(0.75rem, 1.4vw, 0.8125rem);
    display: flex;
    align-items: center;
    gap: 8px;
}

.scan-status.scanning {
    background-color: #cfe2ff;
    border: 1px solid #6ea8fe;
    color: #084298;
}

.scan-status.success {
    background-color: #d1e7dd;
    border: 1px solid #a3cfbb;
    color: #0f5132;
}

.scan-status.error {
    background-color: #f8d7da;
    border: 1px solid #f1aeb5;
    color: #842029;
}

.scan-status.hidden {
    display: none;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }

    .top-navbar {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-collapsed .sidebar {
        width: 280px;
    }

    .content {
        margin-left: 0;
        padding: 0;
        padding-top: 70px;
        background: #ffffff;
    }

    .sidebar-collapsed .content {
        margin-left: 0;
    }

    /* Disable tooltips on mobile */
    .sidebar-collapsed .sidebar-menu li a::after {
        display: none;
    }

    /* Show text on mobile even in collapsed mode */
    .sidebar-collapsed .sidebar-menu li a span,
    .sidebar-collapsed .sidebar-header h4 span,
    .sidebar-collapsed .sidebar-heading {
        display: inline;
        font-size: inherit;
        text-indent: 0;
    }

    .sidebar-collapsed .sidebar-menu li a {
        justify-content: flex-start;
        padding: 14px 18px;
        margin: 4px 14px;
        gap: 12px;
    }

    /* User Profile Dropdown - Mobile adjustments */
    .user-profile-info {
        display: none;
    }

    .dropdown-arrow {
        display: none;
    }

    .user-dropdown-menu {
        min-width: 260px;
        right: -8px;
    }

    .system-header {
        flex-direction: column;
        text-align: center;
        gap: clamp(8px, 1.5vw, 12px);
        margin: 0;
    }

    .system-logo {
        width: 60px;
        height: 60px;
    }

    .pdf-column {
        position: static;
        max-height: none;
    }
}

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

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner 0.8s linear infinite;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .content {
        margin-left: 0;
        padding-top: 0;
    }

    .button-group,
    .pdf-upload-section,
    .floating-toggle-btn,
    .toggle-pdf-btn {
        display: none !important;
    }

    .form-layout {
        grid-template-columns: 1fr;
    }
}
