@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #060608;
    --primary: #f97316;
    --primary-glow: rgba(249, 115, 22, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

table.dataTable.display>tbody>tr.even>.sorting_1,
table.dataTable.order-column.stripe>tbody>tr.even>.sorting_1 {
    box-shadow: inset 0 0 0 9999px rgb(0 0 0 / 0%);
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0) !important;
}

table.dataTable.display>tbody>tr.odd>.sorting_1,
table.dataTable.order-column.stripe>tbody>tr.odd>.sorting_1 {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.054);
    box-shadow: inset 0 0 0 9999px rgba(var(--dt-column-ordering), 0) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Glows */
.glow {
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.05) 0%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.glow-1 {
    top: -10%;
    left: -10%;
}

.glow-2 {
    bottom: -10%;
    right: -10%;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

body.sidebar-collapsed .sidebar {
    width: 70px;
    padding: 1rem 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    overflow: hidden;
    padding-left: 0.5rem;
}

body.sidebar-collapsed .nav-text {
    display: none;
}

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

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.85rem;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(234, 88, 12, 0.15);
    /* Corresponde ao fundo marrom/laranja do print */
    color: var(--primary);
}

/* Main Content Adjustments */
.main-content {
    flex-grow: 1;
    margin-left: 240px;
    padding: 1.5rem 2rem;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.welcome h1 {
    font-size: 1.4rem !important;
}

.welcome p {
    font-size: 0.85rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    opacity: 0.04;
    transform: rotate(-15deg);
    transition: all 0.3s ease;
}

.stat-bg-icon svg,
.stat-bg-icon i {
    width: 100px !important;
    height: 100px !important;
    stroke-width: 1.2;
}

.stat-card:hover .stat-bg-icon {
    opacity: 0.08;
    transform: rotate(0deg) scale(1.1);
    right: 5px;
    bottom: 5px;
}


.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
}

/* Container idêntico ao .glass-panel do TVPlus */
.content-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 13%;
    max-width: 200px;
    height: 0.032rem;
    background: linear-gradient(90deg, transparent, #ff700a71 50%, transparent);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0);
    z-index: 10;
}

/* DataTables Overrides to match exactly */
.dataTables_wrapper {
    color: #9ca3af;
}

.top-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.dt-add-btn {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dt-add-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #f97316;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 !important;
}

.dt-add-circle:hover {
    background: rgba(249, 115, 22, 0.25);
    border-color: #f97316;
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.3);
}

.bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

/* Campos de texto padrão */
.dataTables_length select,
.dataTables_filter input,
.swal2-input,
.swal2-textarea {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    background-color: #0a0a0c !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    color: #ffffff !important;
    padding: 14px 16px !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.dataTables_filter input:focus {
    outline: none !important;
    border-color: #f97316 !important;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15) !important;
}

/* Esconder o texto "Pesquisar" externo e deixar só o campo */
.dataTables_filter label {
    font-size: 0 !important;
    color: transparent !important;
}

.dataTables_filter input {
    font-size: 14px !important;
    color: #ffffff !important;
}

/* Custom Select Experience (Ativação Clone) */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    width: 100%;
    background-color: #0a0a0c !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 0.75rem !important;
    color: #ffffff !important;
    padding: 13px 15px !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-color: #ffffff1a !important;
}

.custom-select-trigger:focus,
.custom-select-wrapper.open .custom-select-trigger {
    outline: none !important;
    border-color: #f97316 !important;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15) !important;
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
    fill: #f97316;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #0a0a0c;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    padding: 8px;
}

.custom-select-wrapper.open .custom-select-options {
    display: flex;
    gap: 2px;
}

.custom-select-option {
    padding: 10px 16px;
    font-size: 14px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.custom-select-option:hover,
.custom-select-option.selected {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.custom-select-option.selected {
    color: #f97316;
    font-weight: 500;
}

/* Custom Scrollbar for options */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    margin-bottom: 24px !important;
}

/* TH idêntico */
table.dataTable thead th {
    padding: 12px 16px !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #9ca3af !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-weight: 600 !important;
    text-align: left !important;
}

/* TD idêntico */
table.dataTable tbody td {
    padding: 10px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02) !important;
    font-size: 0.85rem !important;
    color: #ffffff !important;
    background: transparent !important;
    vertical-align: middle !important;
}

table.dataTable tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Identical to Screenshot: First Column Highlight */
table.dataTable tbody tr td:first-child {
    color: #ea580c !important;
    font-weight: 700 !important;
    font-size: 0.95rem;
}

/* Badges idênticos */
.badge-status {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-status.ativo {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-status.vencido {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Action Buttons idênticos ao .btn do original */
.btn-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.btn-action.delete {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-action.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-icon-only {
    padding: 6px !important;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.btn-icon-only svg {
    width: 16px;
    height: 16px;
}

/* DataTables pagination overrides to work with flexbox */
.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
    float: none !important;
    text-align: left !important;
}

.dataTables_filter {
    text-align: right !important;
}

/* Pagination */
.dataTables_paginate .paginate_button {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: #9ca3af !important;
    margin: 0 4px !important;
    padding: 8px 16px !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    border-color: #ea580c !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

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

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

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables / Lists */
.content-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background-color: rgba(0, 0, 0, 0.05);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(230, 230, 230, 0.05)), color-stop(100%, rgba(0, 0, 0, 0.05)));
    background: -webkit-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -moz-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -ms-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -o-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: linear-gradient(to bottom, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%)
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background-color: rgba(0, 0, 0, 0.05);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(230, 230, 230, 0.05)), color-stop(100%, rgba(0, 0, 0, 0.05)));
    background: -webkit-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -moz-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -ms-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: -o-linear-gradient(top, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%);
    background: linear-gradient(to bottom, rgba(230, 230, 230, 0.05) 0%, rgba(0, 0, 0, 0.05) 100%)
}

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

.table-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #ea580c;
    box-shadow: 0 0 20px var(--primary-glow);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
