@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- TEMA ESCURO (Padrão) --- */
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);

    /* Ações */
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --success: #34d399;
    --danger: #fb7185;
    --warning: #fbbf24;
    --info: #38bdf8;
    --accent: #38bdf8;

    /* Glass Effects */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-blur: blur(12px);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Border Radius (Premium Design) */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* --- FONT SIZES (Slim Pattern) --- */
    --fs-lg: 1.5rem;
    --fs-md: 0.875rem;
    --fs-sm: 0.75rem;
}

body.light-mode {
    /* --- TEMA CLARO (Layout Dia) --- */
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

button,
.btn,
.page-link,
.select2-selection,
[onclick] {
    cursor: pointer !important;
}

/* --- HIDE SCROLLBAR BUT ALLOW SCROLL --- */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* --- HIDE SCROLLBAR BUT ALLOW SCROLL --- */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main) !important;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
    font-size: var(--fs-md);
}

/* --- TYPOGRAPHY --- */
h1,
.h1 {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-main);
}

h2,
.h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

h3,
.h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.text-sm {
    font-size: var(--fs-sm) !important;
}

.text-md {
    font-size: var(--fs-md) !important;
}

.text-lg {
    font-size: var(--fs-lg) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-center {
    text-align: center;
}

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

/* -- STANDARD ROW ITEMS FORM -- */
.item-inline-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr min-content;
    gap: 0.75rem;
    align-items: end;
    width: 100%;
}

@media (max-width: 1200px) {
    .item-inline-row {
        grid-template-columns: 1fr 1fr;
    }

    .item-inline-row>div:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .item-inline-row {
        grid-template-columns: 1fr;
    }

    .item-inline-row>div:last-child {
        grid-column: span 1;
    }
}


.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 2rem;
}

.mb-6 {
    margin-bottom: 3rem;
}

.mt-4 {
    margin-top: 1rem;
}

.w-full {
    width: 100%;
}

/* --- COMPONENTS --- */

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Inputs */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control,
.form-glass,
.form-select {
    width: 100%;
    padding: 8px 12px !important;
    background-color: var(--bg-app) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    color: var(--text-main) !important;
    font-size: var(--fs-md);
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus,
.form-glass:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2) !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Fix for browser autofill background and text color */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1e293b inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- PREMIUM SWITCH (Global Override) --- */
.form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0 !important;
    min-height: 1.5rem;
}

.form-switch .form-check-input {
    width: 2.5rem !important;
    height: 1.25rem !important;
    margin-left: 0 !important;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E") !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
    border-color: var(--info) !important;
}

.form-switch .form-check-input:checked {
    background-color: var(--info) !important;
    border-color: var(--info) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E") !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4) !important;
}

.form-switch-premium .switch-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.form-switch-premium .switch-label .label-status {
    color: var(--text-muted);
}

.form-switch-premium .form-check-input:checked~.switch-label .label-status {
    color: var(--success);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: var(--fs-md);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    gap: 8px;
    background: var(--bg-card);
    color: var(--text-main);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Global Delete Action Buttons (Tabelas/Listas - Square Pattern) */
.btn-del-fix,
.btn-excluir-fixada,
.btn-del-prev,
.btn-excluir-subfonte {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 113, 133, 0.05);
    border: 1px solid rgba(251, 113, 133, 0.2);
    color: var(--danger);
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.btn-del-fix:hover,
.btn-excluir-fixada:hover,
.btn-del-prev:hover,
.btn-excluir-subfonte:hover {
    background: rgba(251, 113, 133, 0.15);
    color: var(--danger);
    /* Mantém o vermelho padrão da lixeira */
    border-color: rgba(251, 113, 133, 0.4);
    transform: scale(1.05);
}

/* Alert/Toast */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.2);
    color: var(--danger);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icons replacement (simple CSS shapes if needed, usually font icons) */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* --- NAVBAR --- */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 3000;
}

/* LOGO ANTIGA (comentada para rollback)
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
*/

/* LOGO NOVA - SVG SIAFIC */
.logo-siafic {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 4rem;
    background: linear-gradient(135deg, #fff 0%, #a5c7ff 50%, #4a90e2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.5));
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: filter 0.3s ease;
}

.logo-siafic:hover {
    filter: drop-shadow(0 0 18px rgba(74, 144, 226, 0.8));
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-user-info {
    text-align: right;
    line-height: 1.2;
}

.nav-user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.nav-user-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-icon-soft {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-soft:hover {
    background: rgba(56, 189, 248, 0.15);
    /* Sky blue tint */
    color: #38bdf8;
    /* Accent color text */
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

.btn-logout {
    color: var(--danger) !important;
    border-color: rgba(251, 113, 133, 0.1);
    background: rgba(251, 113, 133, 0.05);
}

.btn-logout:hover {
    background: rgba(251, 113, 133, 0.15) !important;
    color: #ff8fa3 !important;
    /* Brighter red for the icon to simulate 'lighting up' */
    border-color: rgba(251, 113, 133, 0.3);
    box-shadow: 0 0 15px rgba(251, 113, 133, 0.4);
    transform: translateY(-2px);
}

/* --- DASHBOARD GRID & CARDS (Premium Redesign) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.card-module {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-module::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
    pointer-events: none;
}

.card-module:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.3);
}

.card-module:hover::before {
    width: 320px;
    height: 320px;
}

.module-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 24px;
    transition: all 0.4s ease;
    z-index: 1;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.card-module:hover .module-icon {
    background: var(--primary);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.module-content {
    z-index: 1;
    width: 100%;
}

.module-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    transition: all 0.3s;
    letter-spacing: -0.01em;
}

.module-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
    opacity: 0.7;
    transition: all 0.3s;
}

.card-module:hover .module-subtitle {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* --- SIDEBAR --- */
/* Adjust Sidebar to match new height logic if needed */
.sidebar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    min-height: 100%;
    padding: 1.5rem 1rem;
}

.sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* --- CONTENT AREA --- */
.main-content {
    padding: 2rem;
    height: calc(100vh - 80px);
    /* Adjust based on navbar height */
    overflow-y: auto;
    padding-bottom: 100px;
    /* Space for footer */
    /* margin-top removed because navbar is sticky and takes space in flow */
    width: 100%;
    /* Ensure it tries to take width */
}

/* --- SMALL DASHBOARD GRID (Secondary Panels) --- */
.dashboard-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* Smaller min-width */
    gap: 1rem;
    padding: 1rem 0;
}

.card-module-sm {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

.card-module-sm:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
}

.card-module-sm .module-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    border-radius: 12px;
}

.card-module-sm .module-title {
    font-size: 0.75rem;
    /* Smaller font */
}

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
    color: var(--text-muted) !important;
}

.breadcrumb-item a {
    color: var(--text-muted) !important;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-main) !important;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: background 0.3s, color 0.3s;
}

.btn-footer-debug {
    opacity: 0.3;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.btn-footer-debug:hover {
    opacity: 1;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

/* --- FORM SELECT --- */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

select.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(15, 23, 42, 0.2);
}

/* --- UTILITIES --- */
.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.text-white {
    color: white;
}

.text-secondary {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.opacity-75 {
    opacity: 0.75;
}

.opacity-50 {
    opacity: 0.5;
}

.rounded-circle {
    border-radius: 50%;
}

.border-bottom {
    border-bottom: 1px solid var(--glass-border);
}

.pb-4 {
    padding-bottom: 1rem;
}

.me-3 {
    margin-right: 1rem;
}

.ms-2 {
    margin-left: 0.5rem;
}


/* --- PREMIUM COMPONENTS (Tables, Filters, Forms) --- */

/* Premium Tables */
.galaxy-table {
    width: 100%;
    border-collapse: collapse;
    /* Mudar de separate para collapse para remover linha dupla */
    color: var(--text-muted);
    /* Bootstrap Override */
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-muted);
    background-color: transparent !important;
}

.galaxy-table th,
.galaxy-table td {
    background-color: transparent !important;
    color: inherit;
}

.table-header-premium th {
    background: var(--bg-app);
    /* Mantém a cor atual de fundo para o label das colunas */
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--fs-sm);
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border) !important;
    /* Linha de base do cabeçalho */
}

.galaxy-table tbody tr {
    background: var(--bg-app);
    /* Mesma cor de fundo dos campos de edição para os registros */
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
    /* Mantém o destaque da linha entre registros */
    cursor: pointer;
}

body.light-mode .galaxy-table tbody tr {
    background: var(--bg-app);
    /* Ajustado para acompanhar a cor de fundo do campo no modo claro */
}

.galaxy-table tbody tr td {
    padding: 10px 16px;
    vertical-align: middle;
    color: var(--text-main);
    font-size: var(--fs-md);
}

/* Segundo registro (meta) dentro do mesmo campo */
.grid-meta-text {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.galaxy-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.galaxy-table tbody tr.tr-selected {
    background: rgba(99, 102, 241, 0.45) !important;
    border-left: 6px solid #6366f1 !important;
    box-shadow: inset 0 0 25px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
    transform: scale(1.002);
    position: relative;
    z-index: 1;
}

.galaxy-table tbody tr.tr-selected td {
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.sortable-header {
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.sortable-header:hover {
    color: white;
}

.sort-active {
    color: var(--primary) !important;
}

/* Premium Buttons (Glass Variants) */
.btn-glass-premium {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.btn-glass-premium:hover:not(.btn-disabled-premium) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-glass-success {
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

.btn-glass-success:hover {
    background: rgba(52, 211, 153, 0.2);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
    transform: translateY(-1px);
}

.btn-glass-danger {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.2);
}

.btn-glass-danger:hover {
    background: rgba(251, 113, 133, 0.2);
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.4);
    box-shadow: 0 0 15px rgba(251, 113, 133, 0.3);
    transform: translateY(-1px);
}

.btn-glass-warning {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
}

.btn-glass-warning:hover {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    transform: translateY(-1px);
}

.btn-glass-info {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

.btn-glass-info:hover {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

.btn-disabled-premium,
.btn:disabled,
button:disabled {
    cursor: not-allowed;
    pointer-events: none;
    filter: brightness(1.1);
    /* Mantém o brilho interno */
}

/* Borda acesa na cor do botão durante o processamento (Disabled) */
.btn-glass-success:disabled {
    border-color: rgba(52, 211, 153, 0.6) !important;
    background: rgba(52, 211, 153, 0.15) !important;
}

.btn-glass-danger:disabled {
    border-color: rgba(251, 113, 133, 0.6) !important;
    background: rgba(251, 113, 133, 0.15) !important;
}

.btn-glass-info:disabled {
    border-color: rgba(56, 189, 248, 0.6) !important;
    background: rgba(56, 189, 248, 0.15) !important;
}

.btn-glass-warning:disabled {
    border-color: rgba(251, 191, 36, 0.6) !important;
    background: rgba(251, 191, 36, 0.15) !important;
}

.btn-glass-premium:disabled {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Toolbar & Filters */
.toolbar-premium {
    margin-bottom: 0 !important;
    /* Managed by container usually, or to avoid double spacing */
}

.filter-premium-grid {
    padding: 1.5rem;
}

/* Form Sections */
.form-section-premium {
    border: 1px solid var(--glass-border);
}

.form-label-premium {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modals (Custom Glass) */
.modal-content.glass-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--glass-border);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Premium Badges */
.badge-galaxy {
    padding: 0.35em 0.8em;
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.75em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-galaxy-success {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.1);
}

.badge-galaxy-danger {
    background: rgba(251, 113, 133, 0.1);
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.2);
    box-shadow: 0 0 10px rgba(251, 113, 133, 0.1);
}

.badge-galaxy-warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
}

.badge-galaxy-info {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}



.page-nav-glass {
    background: rgba(30, 41, 59, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 8px !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
}

.page-nav-glass:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
    color: #fff !important;
}

.page-item.active .page-nav-glass {
    background: var(--gradient-premium) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.page-item.disabled .page-nav-glass {
    opacity: 0.2;
    pointer-events: none;
}

/* Select2 Premium Overrides - UNIFICADO SLIM */
.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bg-app) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    color: var(--text-main) !important;
    min-height: 38px !important;
    /* Altura padrão para bater com input slim */
    padding: 4px 12px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2) !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: normal !important;
    padding-left: 0 !important;
    font-size: var(--fs-md) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bg-app) !important;
    border-color: var(--border) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px !important;
    margin-top: 4px !important;
    overflow: hidden !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 10px 14px !important;
    color: var(--text-main) !important;
    font-size: var(--fs-md) !important;
    transition: background 0.1s ease !important;
}

/* Faixa de Seleção Azul Premium */
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: var(--primary) !important;
    color: white !important;
}

/* Suporte para Select Nativo */
select option {
    background-color: var(--bg-app);
    color: var(--text-main);
}


/* --- GLOBAL LOADING OVERLAY --- */
.loading-overlay-glass {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

.animate-pulse-slow {
    animation: pulse-soft 2s infinite ease-in-out;
}

/* --- STANDARDIZED PREMIUM LOADER (AS PER IMAGE) --- */
.loader-content {
    text-align: center;
    width: 100%;
}

.loader-spinner-premium {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #cbd5e1;
    border-radius: 50%;
    animation: spin-loader 0.8s linear infinite;
    margin: 0 auto 2rem;
    display: block;
}

@keyframes spin-loader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-brand {
    font-size: 2.25rem;
    font-weight: 700;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.loader-msg {
    color: #38bdf8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 600;
    opacity: 0.9;
}

/* --- PREMIUM DELETE MODAL --- */
.modal-confirm-delete .modal-content {
    background: rgba(7, 10, 18, 0.98) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(251, 113, 133, 0.5) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9) !important;
    overflow: hidden;
}

.modal-confirm-delete .delete-icon-container {
    width: 100px;
    height: 100px;
    background: rgba(251, 113, 133, 0.2);
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 2rem !important;
    color: #ff8fa3 !important;
    font-size: 3.5rem !important;
    box-shadow: 0 0 50px rgba(251, 113, 133, 0.4);
    border: 2px solid rgba(251, 113, 133, 0.4);
    position: relative;
    z-index: 10;
}

.modal-confirm-delete .modal-body {
    padding: 3.5rem 2rem !important;
    background: transparent !important;
}

.modal-confirm-delete .identification-box {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
}

.modal-confirm-delete .identification-text {
    color: #ffffff !important;
    font-size: 0.85rem !important;
    font-weight: 500;
}

.modal-confirm-delete .processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    display: none !important;
    /* Garantir que comece escondido */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1055;
    /* Acima do body do modal */
    border-radius: var(--radius-lg);
}

.modal-confirm-delete .processing-overlay.active {
    display: flex !important;
}

/* --- LIGHT MODE REFINEMENTS (Layout Dia) --- */
body.light-mode {
    --glass-border: rgba(0, 0, 0, 0.05);
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(25px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .glass-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .form-control,
body.light-mode .form-glass,
body.light-mode .form-select,
body.light-mode .select2-container--bootstrap-5 .select2-selection {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

body.light-mode .sidebar {
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .nav-link:hover {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
}

body.light-mode .btn-icon-soft {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
}

body.light-mode .btn-icon-soft:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
}

body.light-mode .card-module {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .card-module:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.12) !important;
}

/* Modal Deletion Light Mode */
body.light-mode .modal-confirm-delete .modal-content {
    background: #ffffff !important;
    border-color: rgba(251, 113, 133, 0.3) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

body.light-mode .modal-confirm-delete .identification-box {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .modal-confirm-delete .identification-text {
    color: #1e293b !important;
}

body.light-mode .modal-confirm-delete .delete-icon-container {
    background: rgba(251, 113, 133, 0.1) !important;
    box-shadow: 0 0 30px rgba(251, 113, 133, 0.2) !important;
}

body.light-mode .modal-confirm-delete .modal-body .h4,
body.light-mode .modal-confirm-delete .modal-body h4 {
    color: #0f172a !important;
}

body.light-mode .modal-confirm-delete .modal-body .text-muted {
    color: #475569 !important;
}


body.light-mode .card-module:hover .module-subtitle {
    color: var(--primary) !important;
    opacity: 0.8;
}

body.light-mode .module-icon {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .card-module:hover .module-icon {
    background: var(--primary) !important;
    color: #ffffff !important;
}

body.light-mode .text-white {
    color: #1e293b !important;
}

body.light-mode .text-white-50 {
    color: #64748b !important;
}

body.light-mode .galaxy-table thead tr {
    background: #f8fafc !important;
}

body.light-mode .table-header-premium th {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

/* --- LIGHT MODE REFINEMENTS: Buttons & Switches --- */
body.light-mode .btn-glass-premium {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #64748b !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

body.light-mode .btn-glass-premium:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .btn-glass-success {
    background: rgba(52, 211, 153, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
}

body.light-mode .btn-glass-danger {
    background: rgba(251, 113, 133, 0.15) !important;
    border-color: rgba(251, 113, 133, 0.3) !important;
}

body.light-mode .btn-glass-warning {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

body.light-mode .btn-glass-info {
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
}

/* Light Mode Switch Fix */
body.light-mode .form-switch .form-check-input {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='rgba(0,0,0,0.2)'/%3E%3C/svg%3E") !important;
}

body.light-mode .form-switch .form-check-input:checked {
    background-color: var(--info) !important;
    border-color: var(--info) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E") !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3) !important;
}

body.light-mode .form-switch-premium .switch-label .label-status {
    color: #64748b !important;
}

body.light-mode .form-switch-premium .form-check-input:checked~.switch-label .label-status {
    color: var(--success) !important;
}

/* --- GRID CLEANING (Standard List Views) --- */
/* Remove bold and custom colors from all table cells in list views */
.galaxy-table tbody tr td,
.galaxy-table tbody tr td *,
.galaxy-table tfoot tr td,
.galaxy-table tfoot tr td *,
.galaxy-table .row-total-dfd td,
.galaxy-table .row-total-dfd td * {
    font-weight: 400 !important;
    font-size: var(--fs-md) !important;
    text-shadow: none !important;
}

/* Force standard text color based on theme, ignoring bootstrap text helpers */
.galaxy-table tbody tr td.text-primary,
.galaxy-table tbody tr td.text-success,
.galaxy-table tbody tr td.text-info,
.galaxy-table tbody tr td.text-warning,
.galaxy-table tbody tr td.text-danger,
.galaxy-table tbody tr td .text-primary,
.galaxy-table tbody tr td .text-success,
.galaxy-table tbody tr td .text-info,
.galaxy-table tbody tr td .text-warning,
.galaxy-table tbody tr td .text-danger,
.galaxy-table .row-total-dfd td {
    color: var(--text-main) !important;
}

/* Exception: Badges should keep their bold style for clarity */
.galaxy-table .badge {
    font-weight: 700 !important;
}

/* Meta text (smaller) stays muted */
.grid-meta-text {
    color: var(--text-muted) !important;
    font-size: var(--fs-sm) !important;
}

/* --- LIGHT MODE CONTRAST BOOST --- */
body.light-mode {
    --text-main: #06080a !important;
    --text-muted: #334155 !important;
}

body.light-mode .footer {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top-color: rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05) !important;
    color: #334155 !important;
}

body.light-mode .btn-footer-debug {
    color: #334155 !important;
    opacity: 0.5;
}

body.light-mode .btn-footer-debug:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    opacity: 1;
}

body.light-mode .text-white {
    color: #06080a !important;
}

body.light-mode .text-white-50 {
    color: #475569 !important;
}

/* Darker accents for Light Mode */
body.light-mode .text-info {
    color: #0369a1 !important;
}

body.light-mode .text-warning {
    color: #b45309 !important;
}

body.light-mode .text-success {
    color: #15803d !important;
}

body.light-mode .text-danger {
    color: #b91c1c !important;
}

/* Ensure no shadows are lost in Light Mode */
body.light-mode .glass-card {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1) !important;
}

/* Force light mode colors for badges that should follow text-main */
body.light-mode .badge.bg-glass-premium {
    color: var(--text-main) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* --- PREMIUM TRANSCENDENT TOASTS --- */
.toast-container-premium {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast-premium {
    min-width: 340px;
    max-width: 450px;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: toast-bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    overflow: hidden;
}

@keyframes toast-bounce-in {
    from {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast-premium.hide {
    animation: toast-fade-out 0.4s ease forwards;
}

@keyframes toast-fade-out {
    to {
        transform: translateX(50%) scale(0.9);
        opacity: 0;
    }
}

.toast-premium-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.toast-premium-content {
    flex-grow: 1;
    z-index: 1;
}

.toast-premium-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toast-premium-msg {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    font-weight: 400;
}

.toast-premium-close {
    padding: 5px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    cursor: pointer;
    font-size: 1.2rem;
}

.toast-premium-close:hover {
    color: #fff;
}

/* Success */
.toast-premium-success {
    border-left: 5px solid var(--success);
}

.toast-premium-success .toast-premium-icon {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

/* Error */
.toast-premium-error {
    border-left: 5px solid var(--danger);
}

.toast-premium-error .toast-premium-icon {
    background: rgba(251, 113, 133, 0.15);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(251, 113, 133, 0.2);
}

/* Warning */
.toast-premium-warning {
    border-left: 5px solid var(--warning);
}

.toast-premium-warning .toast-premium-icon {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

/* Info */
.toast-premium-info {
    border-left: 5px solid var(--info);
}

.toast-premium-info .toast-premium-icon {
    background: rgba(56, 189, 248, 0.15);
    color: var(--info);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

/* Light Mode */
body.light-mode .toast-premium {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

body.light-mode .toast-premium-title {
    color: #0f172a;
}

body.light-mode .toast-premium-msg {
    color: #475569;
}

body.light-mode .toast-premium-close {
    color: #94a3b8;
}

/* Processing Overlay Light Mode */
body.light-mode .modal-confirm-delete .processing-overlay {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #0369a1 !important;
}

body.light-mode .modal-confirm-delete .processing-overlay .spinner-border {
    color: #0369a1 !important;
}

/* --- GLOBAL ROW SELECTION (Premium Transcendent) --- */
/* Substitui o antigo padrão lilás pesado por um azul suave glass transcendente (.tr-selected) */
.galaxy-table tbody tr.active,
.galaxy-table tbody tr.selected,
.galaxy-table tbody tr.tr-selected,
tr.item-requisicao-row.active,
tr.item-requisicao-row.tr-selected {
    background: rgba(56, 189, 248, 0.1) !important;
    border-left: 3px solid #38bdf8 !important;
    transition: all 0.2s ease;
}

/* Destaque acentuado (escurecido) para o Modo "Dia" */
body.light-mode .galaxy-table tbody tr.active,
body.light-mode .galaxy-table tbody tr.selected,
body.light-mode .galaxy-table tbody tr.tr-selected,
body.light-mode tr.item-requisicao-row.active,
body.light-mode tr.item-requisicao-row.tr-selected {
    background: rgba(3, 105, 161, 0.12) !important;
    border-left: 4px solid #0369a1 !important;
    color: #000000 !important;
    /* Escurecer fonte de toda a linha */
}

/* Escurecer também sub-elementos específicos na linha selecionada (Modo Dia) */
body.light-mode tr.tr-selected td,
body.light-mode tr.tr-selected td *,
body.light-mode tr.tr-selected .text-white,
body.light-mode tr.tr-selected .text-muted {
    color: #000000 !important;
}

/* Hover suave para indicar interatividade */
.galaxy-table tbody tr.pointer:hover:not(.active):not(.selected):not(.tr-selected) {
    background: rgba(255, 255, 255, 0.03) !important;
}

body.light-mode .galaxy-table tbody tr.pointer:hover:not(.active):not(.selected):not(.tr-selected) {
    background: rgba(0, 0, 0, 0.02) !important;
}

/* --- RESPONSIVE MOBILE LAYOUT --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-items {
        gap: 0.5rem;
    }

    .d-none-mobile {
        display: none !important;
    }

    .header-context-box {
        margin-right: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .nav-user-info {
        display: none;
    }

    /* Sidebar Mobile */
    .sidebar-wrapper {
        position: fixed !important;
        top: 0;
        left: -280px;
        width: 280px !important;
        height: 100vh !important;
        z-index: 2000;
        background: var(--bg-app) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        display: block !important;
        padding-top: 80px;
        /* Evita ficar sob o header */
    }

    body.sidebar-open .sidebar-wrapper {
        left: 0;
    }

    .main-content {
        padding: 1rem !important;
    }

    .footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    /* Dashboard Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

/* --- QUICK ACTIONS PREMIUM --- */
.btn-action-premium {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.btn-action-premium:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-action-premium .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-action-premium .title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.btn-action-premium .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

body.light-mode .btn-action-premium {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .btn-action-premium:hover {
    background: #f8fafc;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}   
 