html {
    overflow-x: hidden;
}

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --topbar-height: 56px;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --topbar-bg: #ffffff;
    --content-bg: #f0f2f5;
    --primary-accent: #4361ee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--content-bg);
    font-size: 0.95rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.sidebar-header a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    white-space: nowrap;
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.6rem;
}
.sidebar-logo-wrapper i {
    font-size: 1.5rem;
    color: var(--primary-accent);
    flex-shrink: 0;
}
.sidebar-logo-wrapper span {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    white-space: nowrap;
}

.sidebar-header i {
    font-size: 1.4rem;
    color: var(--primary-accent);
}

.sidebar-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer small {
    color: rgba(255,255,255,0.3);
    font-size: 0.72rem;
    line-height: 1.3;
}

.sidebar-search {
    padding: 0.65rem 1rem;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sidebar-text);
    font-size: 0.85rem;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search input::placeholder {
    color: var(--sidebar-text);
}

.sidebar-search input:focus {
    border-color: var(--primary-accent);
}

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

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

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-section {
    padding: 0.65rem 1rem 0.35rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-menu li a i:first-child {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary-accent);
}

/* ===== SUBMENU ACCORDION ===== */
.sidebar-menu li.has-submenu > a .arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.sidebar-menu li.has-submenu.open > a .arrow {
    transform: rotate(180deg);
}

.sidebar-menu li.has-submenu > a {
    cursor: pointer;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-menu li.has-submenu.open .submenu {
    max-height: 500px;
}

.sidebar-menu li.has-submenu:not(.open) .submenu {
    max-height: 0;
}

.submenu li a {
    padding-left: 2.75rem;
    font-size: 0.9rem;
}

.submenu li a i:first-child {
    font-size: 0.82rem;
    width: 16px;
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1030;
    transition: left 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #4a5568;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.topbar-toggle:hover {
    color: var(--primary-accent);
}

.topbar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: #4a5568;
}

.topbar-user i {
    font-size: 1.3rem;
    color: var(--primary-accent);
}

.user-avatar {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    border-radius: 50% !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    border: 2px solid;
    margin-right: 4px;
    background: transparent !important;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--topbar-height);
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

/* ===== SIDEBAR COLLAPSED ===== */
body.sidebar-collapsed .sidebar {
    width: 60px;
}

body.sidebar-collapsed .sidebar-header span,
body.sidebar-collapsed .sidebar-search,
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-menu li a span,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .sidebar-menu li.has-submenu > a .arrow,
body.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .sidebar-logo {
    display: none;
}

body.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 0.7rem 0;
}

body.sidebar-collapsed .sidebar-menu li a i:first-child {
    margin: 0;
    font-size: 1.2rem;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

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

body.sidebar-collapsed .sidebar-header a {
    justify-content: center;
}

body.sidebar-collapsed .topbar {
    left: 60px;
}

body.sidebar-collapsed .main-content {
    margin-left: 60px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-mobile-open .sidebar-overlay {
        display: block;
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    body.sidebar-collapsed .topbar {
        left: 0;
    }

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

/* ===== EXISTING STYLES (preserved) ===== */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
    margin-bottom: 1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-body.py-2 {
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
}

.card-body.p-0 {
    padding: 0 !important;
    overflow-x: auto;
}

.card-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    font-size: 1rem;
}

.card-header.bg-success {
    background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #055160 0%, #087990 100%) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #664d03 0%, #997404 100%) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #58151c 0%, #842029 100%) !important;
}

.stat-card {
    transition: transform 0.2s;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-3px);
}

table.dataTable {
    font-size: 0.9rem;
}

table.dataTable td, table.dataTable th {
    vertical-align: middle;
}

.btn-sm {
    font-size: 0.88rem;
    padding: 0.3rem 0.65rem;
}

.btn-xs {
    font-size: 0.82rem;
    padding: 0.2rem 0.5rem;
}

.badge {
    font-size: 0.82rem;
    padding: 0.35em 0.6em;
}

.footer {
    font-size: 0.88rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.filter-section {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
}

@media print {
    .sidebar, .topbar, .sidebar-overlay, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; margin-top: 0 !important; }
}

/* ===== DASHBOARD REDESIGN ===== */
.stat-card-sm {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
    border: none;
    border-radius: 10px;
}
.stat-card-sm:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.stat-card-sm .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-card-sm h3 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-card-sm .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.stat-card-sm a.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.stat-card-sm a.stat-link:hover {
    color: inherit;
}
.search-card {
    background: #fff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.search-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}
.search-card .input-group {
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.search-card .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}
.search-card .input-group-text {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-right: none;
    color: #a0aec0;
    padding-left: 0.9rem;
    padding-right: 0.5rem;
}
.search-card .form-control {
    border: 1px solid #e2e8f0;
    border-left: none;
    box-shadow: none;
    font-size: 0.95rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: #fff;
}
.search-card .form-control:focus {
    box-shadow: none;
    border-color: #e2e8f0;
}
.search-card .form-control::placeholder {
    color: #a0aec0;
    font-size: 0.9rem;
}
.search-card .btn-primary {
    border-radius: 0 6px 6px 0;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 500;
}
.filter-card {
    background: #fff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
.filter-card .form-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #718096;
    margin-bottom: 0.35rem;
}
.filter-card .form-select-sm {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    font-size: 0.85rem;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.filter-card .form-select-sm:hover {
    border-color: #cbd5e0;
}
.filter-card .form-select-sm:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}
.filter-card .btn-outline-secondary {
    border-radius: 8px;
    font-size: 0.8rem;
}
.filter-card .filter-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(67, 97, 238, 0.08);
    color: var(--primary-accent);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}
.chart-card {
    background: #fff;
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.chart-card .chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}
.chart-card .chart-container-donut {
    position: relative;
    height: 250px;
    width: 100%;
}
.dashboard-table {
    font-size: 0.9rem;
    margin-bottom: 0;
    width: auto;
    min-width: 100%;
}
.dashboard-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 0.7rem 0.85rem;
    background: #f8f9fa;
}
.dashboard-table td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}
.dashboard-table tr:hover td {
    background: #f8f9ff;
}
.timeline {
    position: relative;
    padding-left: 1.5rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item {
    position: relative;
    padding-bottom: 1rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary-accent);
    background: #fff;
}
.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-bottom: 0.15rem;
}
.timeline-item .timeline-text {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.4;
}
.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title i {
    color: var(--primary-accent);
}
.search-result-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
@media (max-width: 768px) {
    .stat-card-sm h3 {
        font-size: 1.4rem;
    }
    .stat-card-sm .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .stat-card-sm .stat-label {
        font-size: 0.75rem;
    }
}

/* ===== FORM CONTROLS ===== */
.form-label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.form-select-sm, .input-group-sm .form-select, .input-group-sm .form-control {
    font-size: 0.88rem;
    padding: 0.3rem 0.65rem;
}

.form-control, .form-select {
    font-size: 0.92rem;
}

/* ===== PAGINATION ===== */
.page-link {
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
}

/* ===== MODAL ===== */
.modal-title {
    font-size: 1.1rem;
}

.modal-body {
    font-size: 0.95rem;
}

/* ===== ALERTS ===== */
.alert {
    font-size: 0.92rem;
    padding: 0.75rem 1rem;
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
    font-size: 0.92rem;
}

/* ===== NAV TABS ===== */
.nav-tabs .nav-link {
    font-size: 0.92rem;
    padding: 0.5rem 1rem;
}
.nav-tabs .nav-link.active {
    background-color: var(--primary-accent, #4361ee) !important;
    border-color: var(--primary-accent, #4361ee) !important;
    color: #fff !important;
}
.nav-tabs .nav-link.active .badge {
    background-color: rgba(255,255,255,0.3) !important;
    color: #fff !important;
}

/* ===== PANEL DE ACCIONES (view.php) ===== */
.acciones-panel {
    border-top: 3px solid var(--bs-primary, #0d6efd) !important;
    border-radius: 0.5rem;
    background: #fff;
}
.acciones-panel .card-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.acciones-panel .card-body {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

/* ===== BLOQUES DE INFORMACIÓN (view.php) ===== */
.info-block {
    margin-bottom: 0.75rem;
    border: 1px solid #eef0f3;
    border-radius: 6px;
    overflow: hidden;
}
.info-block:last-child { margin-bottom: 0; }
.info-block-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid #eef0f3;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}
.info-block-label { line-height: 1; }
.bg-soft-primary { background: #eef4ff; color: #0d6efd; }
.bg-soft-success { background: #edfbf1; color: #198754; }
.bg-soft-info    { background: #eaf6fd; color: #0dcaf0; }
.info-block-body { padding: 0; background: #fff; }
.info-cell {
    padding: 0.35rem 0.7rem;
    border-right: 1px solid #f1f3f5;
    border-bottom: 1px solid #f1f3f5;
}
.info-cell-block { padding-top: 0.5rem; border-top: 1px dashed #e9ecec; border-right: none; border-bottom: none; }
.info-key {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #9aa4ad;
    margin-bottom: 0.1rem;
}
.info-val {
    font-size: 0.88rem;
    color: #212529;
    line-height: 1.35;
    word-break: break-word;
}

/* ===== OBSERVACIONES / COMENTARIOS (view.php) ===== */
.obs-comment {
    border-left: 3px solid;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
}
.obs-comment:last-child { margin-bottom: 0 !important; }
.obs-comment-head { gap: 0.5rem; flex-wrap: wrap; }
.obs-comment-head .obs-date { color: #6c757d; font-weight: 400; font-size: 0.75rem; }
.obs-comment-body {
    color: #495057;
    line-height: 1.45;
    white-space: pre-wrap;
}

/* ===== POPOVER DE AUDITORÍA (view.php) ===== */
.popover-auditoria { max-width: 420px; }
.popover-auditoria .popover-body { padding: 0.4rem 0.5rem; }
.aud-pop { max-height: 320px; overflow-y: auto; padding-right: 0.25rem; }
.aud-item {
    border-left: 2px solid #e9ecef;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.4rem;
    border-radius: 3px;
    background: #fafbfc;
}
.aud-item:last-child { margin-bottom: 0; }
.aud-acc { font-weight: 700; color: #0d6efd; font-size: 0.78rem; }
.aud-date { color: #adb5bd; font-size: 0.72rem; margin-left: 0.35rem; }
.aud-user { color: #6c757d; font-size: 0.75rem; margin-top: 0.1rem; }
.aud-desc { display: block; color: #495057; font-size: 0.75rem; margin-top: 0.15rem; line-height: 1.35; }

/* ===== ARCHIVOS ADJUNTOS - TARJETAS HORIZONTALES ===== */
.file-row {
    border: 1px solid #eef1f5;
    background: #fdfdfe;
    transition: background 0.15s, border-color 0.15s;
}
.file-row:hover {
    background: #f4f7fb;
    border-color: #d0d9e6;
}
.file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.bg-soft-primary { background: rgba(13,110,253,.1); }
.bg-soft-warning { background: rgba(255,193,7,.12); }
.bg-soft-info { background: rgba(13,202,240,.1); }

/* ===== BUSCADOR GLOBAL ===== */
.global-search-wrapper { position: relative; z-index: 1050; }
.global-search {
    display: flex; align-items: center; gap: 8px;
    background: #f1f3f5; border: 1px solid #dee2e6; border-radius: 8px;
    padding: 5px 12px; transition: all 0.2s;
}
.global-search:focus-within { background: #fff; border-color: var(--primary-accent); box-shadow: 0 0 0 3px rgba(67,97,238,0.15); }
.global-search i { color: #868e96; font-size: 0.85rem; }
.global-search input {
    border: none; background: transparent; outline: none;
    font-size: 0.85rem; width: 180px; color: #333;
}
.global-search input:focus { width: 260px; }
.global-search input::placeholder { color: #adb5bd; }
.search-shortcut {
    font-size: 0.65rem; color: #adb5bd; background: #e9ecef;
    border: 1px solid #dee2e6; border-radius: 4px;
    padding: 1px 5px; white-space: nowrap; font-family: monospace;
}
.global-search:focus-within .search-shortcut { display: none; }
.search-backdrop {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,0.2); backdrop-filter: blur(2px);
    z-index: 1040;
}
.search-backdrop.active { display: block; }
.global-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
    width: 380px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1051;
    animation: searchDropIn 0.15s ease-out;
}
@keyframes searchDropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.global-search-results.active { display: block; }
.gsr-module {
    padding: 12px 16px 4px; font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; color: #94a3b8;
    display: flex; align-items: center; gap: 6px;
}
.gsr-module i { font-size: 0.7rem; }
.gsr-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; text-decoration: none !important;
    color: #333; transition: all 0.15s; cursor: pointer;
    border-bottom: 1px solid #f1f5f9; margin: 0 8px;
    border-radius: 8px;
}
.gsr-item:last-of-type { border-bottom: none; margin-bottom: 8px; }
.gsr-item:hover { background: #f8fafc; text-decoration: none !important; }
.gsr-item .gsr-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; color: #fff; flex-shrink: 0;
}
.gsr-item .gsr-info { flex: 1; min-width: 0; }
.gsr-item .label { font-size: 0.85rem; font-weight: 600; color: #1e293b !important; line-height: 1.3; }
.gsr-item .sub { font-size: 0.75rem; color: #64748b; margin-top: 2px; line-height: 1.3; }
.gsr-item .gsr-arrow { color: #cbd5e1; font-size: 0.7rem; flex-shrink: 0; transition: color 0.15s; }
.gsr-item:hover .gsr-arrow { color: #94a3b8; }
.gsr-empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 0.85rem; }
.gsr-empty i { font-size: 1.2rem; display: block; margin-bottom: 8px; opacity: 0.5; }
