        :root {
            --success-color: #10b981;
            --danger-color: #ef4444;
            --warning-color: #f59e0b;
            --info-color: #3b82f6;
            --light-color: #f3f4f6;
            --dark-color: #1f2937;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--light-color);
            color: var(--dark-color);
        }

        /* Navbar */
        .navbar {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            padding: 1rem 0;
        }

        .navbar-brand {
            font-size: 1.5rem;
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        .nav-link {
            color: rgba(255, 255, 255, 0.85) !important;
            transition: color 0.3s ease;
            margin: 0 0.5rem;
        }

        .nav-link:hover {
            color: #ffffff !important;
        }

        .nav-link.active {
            color: #ffffff !important;
            border-bottom: 3px solid #ffffff;
            padding-bottom: 0.3rem;
        }

        /* Main Container */
        .main-container {
            padding: 2rem 0;
            min-height: calc(100vh - 120px);
        }

        /* Cards */
        .card {
            border: none;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
        }

        .card-header {
            background: linear-gradient(135deg, var(--primary-color), var(--info-color));
            color: white;
            border-radius: 12px 12px 0 0 !important;
            padding: 1.5rem;
        }

        /* Buttons */
        .btn {
            border-radius: 8px;
            padding: 0.6rem 1.5rem;
            font-weight: 600;
            transition: all 0.3s ease;
            border: none;
        }

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

        .btn-primary:hover {
            background-color: var(--secondary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        }

        .btn-sm {
            padding: 0.4rem 0.8rem;
            font-size: 0.875rem;
        }

        /* Floating Action Button */
        .fab {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
            transition: all 0.3s ease;
            text-decoration: none;
            z-index: 999;
        }

        .fab:hover {
            background-color: var(--secondary-color);
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
            color: white;
            text-decoration: none;
        }

        /* Breadcrumb */
        .breadcrumb {
            background-color: transparent;
            padding: 1rem 0;
        }

        .breadcrumb-item {
            color: var(--dark-color);
        }

        .breadcrumb-item.active {
            color: var(--primary-color);
            font-weight: 600;
        }

        /* Footer */
        footer {
            background: var(--dark-color);
            color: #d1d5db;
            padding: 2rem 0;
            margin-top: 4rem;
            border-top: 3px solid var(--primary-color);
        }

        footer a {
            color: #f3f4f6;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        footer a:hover {
            color: var(--primary-color);
        }

        @media print {
            .navbar, footer, .fab, .btn, form, .breadcrumb { display: none !important; }
            body { background: white !important; }
            .main-container { padding: 0 !important; }
            .card { box-shadow: none !important; }
        }

        /* Table */
        .table-hover tbody tr:hover {
            background-color: rgba(37, 99, 235, 0.05);
        }

        .table thead th {
            background-color: var(--light-color);
            color: var(--dark-color);
            font-weight: 600;
            border-bottom: 2px solid var(--primary-color);
        }

        /* Forms */
        .form-control, .form-select {
            border-radius: 8px;
            border: 1px solid #d1d5db;
            padding: 0.75rem;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .form-control:focus, .form-select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
        }

        .form-label {
            font-weight: 600;
            color: var(--dark-color);
            margin-bottom: 0.5rem;
        }

        /* Alerts */
        .alert {
            border-radius: 8px;
            border: none;
        }

        .alert-success {
            background-color: rgba(16, 185, 129, 0.1);
            color: #047857;
            border-left: 4px solid var(--success-color);
        }

        .alert-danger {
            background-color: rgba(239, 68, 68, 0.1);
            color: #991b1b;
            border-left: 4px solid var(--danger-color);
        }

        .alert-warning {
            background-color: rgba(245, 158, 11, 0.1);
            color: #92400e;
            border-left: 4px solid var(--warning-color);
        }

        /* Badges */
        .badge {
            padding: 0.5rem 0.75rem;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.85rem;
        }

        /* Status */
        .status-ativo {
            background-color: rgba(16, 185, 129, 0.2);
            color: #047857;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-weight: 600;
        }

        .status-inativo {
            background-color: rgba(107, 114, 128, 0.2);
            color: #374151;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-weight: 600;
        }

        .status-atrasado {
            background-color: rgba(239, 68, 68, 0.2);
            color: #991b1b;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-weight: 600;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .main-container {
                padding: 1rem 0;
            }

            .fab {
                width: 50px;
                height: 50px;
                font-size: 1.25rem;
                bottom: 1rem;
                right: 1rem;
            }

            .navbar-brand {
                font-size: 1.25rem;
            }
        }

        /* ==========================================================
           BIBLIOTECA MASTER v1.0 — TECH PREMIUM
           ========================================================== */

        :root {
            --tm-navy: #071426;
            --tm-navy-2: #0b1f38;
            --tm-blue: #1677ff;
            --tm-blue-light: #38bdf8;
            --tm-bg: #f4f7fb;
            --tm-text: #172033;
            --tm-muted: #718096;
            --tm-border: #e5eaf1;
            --tm-white: #ffffff;
            --tm-sidebar-width: 270px;
            --tm-header-height: 78px;
        }

        body {
            margin: 0;
            background: var(--tm-bg);
            color: var(--tm-text);
        }

        .tm-app {
            min-height: 100vh;
            display: flex;
        }

        .tm-sidebar {
            width: var(--tm-sidebar-width);
            min-width: var(--tm-sidebar-width);
            min-height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            z-index: 1040;
            display: flex;
            flex-direction: column;
            background:
                linear-gradient(180deg, #071426 0%, #0b1d34 55%, #081523 100%);
            color: #fff;
            box-shadow: 8px 0 30px rgba(7, 20, 38, .12);
            transition: width .25s ease, transform .25s ease;
        }

        .tm-brand {
            padding: 22px 20px 18px;
        }

        .tm-brand a {
            display: flex;
            align-items: center;
            gap: 13px;
            color: #fff;
            text-decoration: none;
        }

        .tm-brand-icon {
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: linear-gradient(135deg, var(--tm-blue), var(--tm-blue-light));
            box-shadow: 0 8px 22px rgba(22,119,255,.30);
            font-size: 20px;
        }

        .tm-brand-text {
            display: flex;
            flex-direction: column;
            line-height: 1.15;
        }

        .tm-brand-text strong {
            font-size: 16px;
            letter-spacing: .2px;
        }

        .tm-brand-text small {
            margin-top: 4px;
            color: #7dd3fc;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 1.5px;
        }

        .tm-sidebar-divider {
            height: 1px;
            margin: 0 18px 12px;
            background: rgba(255,255,255,.09);
        }

        .tm-menu {
            padding: 0 13px;
            overflow-y: auto;
        }

        .tm-menu-section {
            margin: 20px 12px 7px;
            color: #6f86a2;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 1.4px;
        }

        .tm-menu-item {
            display: flex;
            align-items: center;
            gap: 13px;
            min-height: 45px;
            padding: 0 13px;
            margin: 3px 0;
            border-radius: 10px;
            color: #b9c8d9;
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            transition: all .18s ease;
        }

        .tm-menu-item i {
            width: 20px;
            text-align: center;
            font-size: 15px;
            color: #7790ad;
        }

        .tm-menu-item:hover {
            color: #fff;
            background: rgba(255,255,255,.07);
            transform: translateX(2px);
        }

        .tm-menu-item:hover i,
        .tm-menu-item.active i {
            color: #7dd3fc;
        }

        .tm-menu-item.active {
            color: #fff;
            background: linear-gradient(90deg, rgba(22,119,255,.30), rgba(56,189,248,.10));
            box-shadow: inset 3px 0 0 var(--tm-blue-light);
        }

        .tm-sidebar-bottom {
            margin-top: auto;
            padding: 14px;
            border-top: 1px solid rgba(255,255,255,.08);
        }

        .tm-user-mini {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px;
            margin-bottom: 8px;
            border-radius: 10px;
            background: rgba(255,255,255,.045);
        }

        .tm-user-avatar {
            width: 36px;
            height: 36px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            background: rgba(56,189,248,.14);
            color: #7dd3fc;
        }

        .tm-user-info {
            min-width: 0;
            display: flex;
            flex-direction: column;
        }

        .tm-user-info strong {
            color: #fff;
            font-size: 13px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tm-user-info small {
            color: #7890a9;
            font-size: 10px;
        }

        .tm-logout {
            display: flex;
            align-items: center;
            gap: 11px;
            padding: 10px 12px;
            color: #aebed0;
            text-decoration: none;
            border-radius: 9px;
            font-size: 13px;
            font-weight: 600;
        }

        .tm-logout:hover {
            color: #fff;
            background: rgba(239,68,68,.12);
        }

        .tm-main {
            width: calc(100% - var(--tm-sidebar-width));
            margin-left: var(--tm-sidebar-width);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            transition: margin-left .25s ease, width .25s ease;
        }

        .tm-header {
            height: var(--tm-header-height);
            min-height: var(--tm-header-height);
            position: sticky;
            top: 0;
            z-index: 1030;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
            padding: 0 28px;
            background: rgba(255,255,255,.94);
            border-bottom: 1px solid var(--tm-border);
            box-shadow: 0 3px 18px rgba(15,23,42,.05);
            backdrop-filter: blur(10px);
        }

        .tm-header-left,
        .tm-header-right {
            display: flex;
            align-items: center;
        }

        .tm-header-left {
            gap: 15px;
            min-width: 0;
        }

        .tm-header-right {
            gap: 22px;
        }

        .tm-sidebar-toggle {
            width: 40px;
            height: 40px;
            border: 1px solid var(--tm-border);
            border-radius: 10px;
            background: #fff;
            color: #475569;
            cursor: pointer;
            transition: all .18s ease;
        }

        .tm-sidebar-toggle:hover {
            color: var(--tm-blue);
            border-color: #bfdbfe;
            background: #eff6ff;
        }

        .tm-page-brand {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .tm-page-brand strong {
            font-size: 16px;
            color: #0f172a;
        }

        .tm-page-brand span {
            margin-top: 2px;
            color: var(--tm-muted);
            font-size: 11px;
        }

        .tm-institution {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 13px;
            border: 1px solid #dbeafe;
            border-radius: 12px;
            background: #f8fbff;
        }

        .tm-institution-icon {
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 9px;
            background: #e0efff;
            color: var(--tm-blue);
        }

        .tm-institution div {
            display: flex;
            flex-direction: column;
            max-width: 220px;
        }

        .tm-institution small {
            color: #64748b;
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 1px;
        }

        .tm-institution strong {
            margin-top: 2px;
            color: #0f3b72;
            font-size: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tm-datetime {
            display: flex;
            align-items: center;
            gap: 9px;
            padding-left: 20px;
            border-left: 1px solid var(--tm-border);
        }

        .tm-datetime > i {
            color: var(--tm-blue);
            font-size: 18px;
        }

        .tm-datetime div {
            display: flex;
            flex-direction: column;
        }

        .tm-datetime strong {
            color: #0f172a;
            font-size: 14px;
            font-variant-numeric: tabular-nums;
        }

        .tm-datetime small {
            color: #64748b;
            font-size: 10px;
            margin-top: 2px;
        }

        .tm-main > .container-xl {
            flex: 1;
            width: 100%;
        }

        footer {
            margin-top: 35px;
        }

        /* Sidebar recolhida */
        body.tm-sidebar-collapsed .tm-sidebar {
            width: 78px;
            min-width: 78px;
        }

        body.tm-sidebar-collapsed .tm-main {
            width: calc(100% - 78px);
            margin-left: 78px;
        }

        body.tm-sidebar-collapsed .tm-brand-text,
        body.tm-sidebar-collapsed .tm-menu-item span,
        body.tm-sidebar-collapsed .tm-menu-section,
        body.tm-sidebar-collapsed .tm-user-info,
        body.tm-sidebar-collapsed .tm-logout span {
            display: none;
        }

        body.tm-sidebar-collapsed .tm-brand {
            padding-left: 17px;
            padding-right: 17px;
        }

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

        body.tm-sidebar-collapsed .tm-menu-item {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }

        body.tm-sidebar-collapsed .tm-user-mini {
            justify-content: center;
        }

        body.tm-sidebar-collapsed .tm-logout {
            justify-content: center;
        }

        @media (max-width: 991.98px) {
            .tm-sidebar {
                transform: translateX(-100%);
            }

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

            .tm-main {
                width: 100%;
                margin-left: 0;
            }

            body.tm-sidebar-collapsed .tm-main {
                width: 100%;
                margin-left: 0;
            }

            .tm-header {
                padding: 0 16px;
            }

            .tm-header-right {
                gap: 10px;
            }

            .tm-page-brand span {
                display: none;
            }

            .tm-institution {
                max-width: 220px;
            }
        }

        @media (max-width: 767.98px) {
            .tm-page-brand {
                display: none;
            }

            .tm-institution {
                max-width: 155px;
            }

            .tm-datetime {
                padding-left: 10px;
            }

            .tm-datetime small {
                display: none;
            }

            .tm-header {
                gap: 8px;
            }
        }

        @media print {
            .tm-sidebar,
            .tm-header,
            .tm-sidebar-toggle {
                display: none !important;
            }

            .tm-main {
                width: 100% !important;
                margin-left: 0 !important;
            }
        }


        /* =========================================================
           BIBLIOTECA MASTER v1.0 — TEMA CLARO / ESCURO
           ========================================================= */

        body.tm-light {
            --tm-bg: #f4f7fb;
            --tm-surface: #ffffff;
            --tm-surface-2: #eef3f8;
            --tm-text: #172033;
            --tm-text-muted: #64748b;
            --tm-border: #dbe3ec;
            --tm-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
        }

        body.tm-dark {
            --tm-bg: #0b1220;
            --tm-surface: #111c2e;
            --tm-surface-2: #17243a;
            --tm-text: #e8eef7;
            --tm-text-muted: #9aa9bd;
            --tm-border: #26364d;
            --tm-shadow: 0 8px 25px rgba(0, 0, 0, 0.30);
        }

        body.tm-light,
        body.tm-dark {
            background: var(--tm-bg);
            color: var(--tm-text);
        }

        body.tm-dark .tm-main,
        body.tm-dark .container,
        body.tm-dark .container-fluid {
            color: var(--tm-text);
        }

        body.tm-dark .card,
        body.tm-dark .modal-content,
        body.tm-dark .dropdown-menu,
        body.tm-dark .list-group-item,
        body.tm-dark .table {
            background-color: var(--tm-surface);
            color: var(--tm-text);
            border-color: var(--tm-border);
        }

        body.tm-dark .table {
            --bs-table-bg: var(--tm-surface);
            --bs-table-color: var(--tm-text);
        }

        body.tm-dark .table > :not(caption) > * > * {
            background-color: var(--tm-surface);
            color: var(--tm-text);
            border-color: var(--tm-border);
        }

        body.tm-dark .text-muted {
            color: var(--tm-text-muted) !important;
        }

        body.tm-dark .form-control,
        body.tm-dark .form-select {
            background-color: var(--tm-surface-2);
            color: var(--tm-text);
            border-color: var(--tm-border);
        }

        body.tm-dark .form-control::placeholder {
            color: #8190a5;
        }

        body.tm-dark .form-control:focus,
        body.tm-dark .form-select:focus {
            background-color: var(--tm-surface);
            color: var(--tm-text);
        }

        body.tm-dark .alert {
            border-color: var(--tm-border);
        }

        body.tm-dark a:not(.tm-menu-item):not(.btn) {
            color: #60a5fa;
        }

        body.tm-dark .breadcrumb-item.active {
            color: var(--tm-text-muted);
        }

        body.tm-dark hr {
            border-color: var(--tm-border);
            opacity: 1;
        }

        /* Botão de tema */
        .tm-theme-toggle {
            width: 42px;
            height: 42px;
            border: 1px solid var(--tm-border, rgba(255,255,255,.15));
            border-radius: 12px;
            background: var(--tm-surface, rgba(255,255,255,.08));
            color: var(--tm-text, inherit);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all .2s ease;
        }

        .tm-theme-toggle:hover {
            transform: translateY(-1px);
            box-shadow: var(--tm-shadow, 0 5px 15px rgba(0,0,0,.12));
        }

        .tm-theme-toggle i {
            font-size: 17px;
        }

        /* Transição suave somente após a página carregar */
        body.tm-theme-ready,
        body.tm-theme-ready .tm-main,
        body.tm-theme-ready .tm-header,
        body.tm-theme-ready .card,
        body.tm-theme-ready .modal-content,
        body.tm-theme-ready .dropdown-menu,
        body.tm-theme-ready .form-control,
        body.tm-theme-ready .form-select {
            transition:
                background-color .25s ease,
                color .25s ease,
                border-color .25s ease,
                box-shadow .25s ease;
        }

        .tm-commercial-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 12px;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
}

.tm-commercial-status small {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    opacity: 0.65;
    line-height: 1;
    margin-bottom: 3px;
}

.tm-commercial-status strong {
    display: block;
    font-size: 0.78rem;
    line-height: 1.1;
}

.tm-status-days {
    display: block;
    font-size: 0.68rem;
    opacity: 0.7;
    margin-top: 3px;
}

.tm-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 9px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Situação da assinatura */

.tm-status-active {
    color: #22c55e;
}

.tm-status-test {
    color: #38bdf8;
}

.tm-status-expired,
.tm-status-suspended,
.tm-status-cancelled,
.tm-status-inactive {
    color: #ef4444;
}

     @media (max-width: 1100px) {
    .tm-commercial-status {
        min-width: auto;
        padding: 7px 10px;
    }

    .tm-commercial-status small {
        display: none;
    }
}

@media (max-width: 768px) {
    .tm-commercial-status {
        display: none;
    }
}

