/* ==========================================================================
   XUI ONE — Painel demonstrativo
   Paleta e tipografia inspiradas no painel XUI de referência.
   ========================================================================== */

:root {
    --topbar: #3d454e;
    --topbar-2: #4a545f;
    --primary: #5089de;
    --primary-dark: #3b6fc0;
    --success: #23b397;
    --info: #56c2d6;
    --warning: #f8cc6b;
    --danger: #f0643b;
    --dark: #414d5f;
    --muted: #98a6ad;
    --border: #e4e9ee;
    --bg: #f1f5f7;
    --card: #ffffff;
    --text: #414d5f;
    --text-soft: #6c757d;
    --shadow: 0 2px 12px rgba(65, 77, 95, .08);
    --radius: 10px;
    --topbar-h: 70px;
    --sidebar-w: 246px;
}

.dark-mode {
    --bg: #1e242c;
    --card: #262e38;
    --text: #e6ebf0;
    --text-soft: #a8b1b6;
    --border: #37414d;
    --dark: #e6ebf0;
    --shadow: 0 2px 16px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { position: relative; min-height: 100%; }
body { margin: 0; overflow-x: hidden; font-family: Poppins, "Work Sans", "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); font-size:14px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.text-muted { color: var(--muted) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.w-75 { width: 75% !important; }
.m-auto { margin-left: auto !important; margin-right: auto !important; }
.text-center { text-align: center !important; }
.nowrap { white-space: nowrap !important; }
.d-none { display: none !important; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.bg-animate {
    min-height: 100vh;
    background: linear-gradient(315deg, #417dc1, #000080, #007fbf, #80daeb);
    background-size: 400% 400%;
    animation: gradient 14s ease infinite;
    position: relative;
}
.bg-animate::before {
    content: "";
    position: absolute; inset: 0;
    background: url(../images/pattern.png) center / cover no-repeat;
    opacity: .16;
    pointer-events: none;
}
@keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.body-full { width: 100%; min-height: 100vh; position: relative; padding: 40px 0 !important; }
.navbar-custom { background-image: url(../images/pattern.png); background-size: cover; }
.account-pages { width: 100%; min-height: calc(100vh - 80px); display: flex; align-items: center; }
.vertical-center { position: relative; top: auto; transform: none; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 15px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.justify-content-center { justify-content: center; }
.col-md-8, .col-lg-6, .col-xl-5 { position: relative; width: 100%; padding: 0 15px; }
@media (min-width: 768px) { .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; } }
@media (min-width: 992px) { .col-lg-6 { flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 1200px) { .col-xl-5 { flex: 0 0 41.6667%; max-width: 41.6667%; } }
.whiteout { filter: brightness(0) invert(1); }
.login-logo { margin-bottom: 10px; }
.login-logo img { max-width: 100%; }
.login-logo p { color: rgba(255,255,255,.75) !important; font-size: 13px; }
.card { background: var(--card); border: 0; border-radius: var(--radius); box-shadow: 0 10px 35px rgba(0,0,0,.18); margin-bottom: 20px; }
.card-body { padding: 24px; }
.card-body.p-4 { padding: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-control {
    display: block; width: 100%; height: 46px; padding: 8px 14px;
    border: 1px solid #d8e0e6; border-radius: 7px; background: #fbfcfd;
    color: var(--dark); outline: none; transition: .2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(80,137,222,.14); background: #fff; }
.form-group.has-error .form-control { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(240,100,59,.12); }
.invalid-feedback { display: none; color: var(--danger); font-size: 12px; margin-top: 5px; }
.form-group.has-error .invalid-feedback { display: block; }
.input-group-wrap { position: relative; }
.input-group-wrap .form-control { padding-right: 46px; }
.password-toggle { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; background: transparent; opacity: .65; }
.login-error { min-height: 18px; color: var(--danger); font-size: 12px; margin: -6px 0 8px; }
.demo-hint { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-soft); background: rgba(80,137,222,.08); border: 1px dashed rgba(80,137,222,.35); border-radius: 6px; padding: 9px 11px; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(35,179,151,.15); flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; padding: 9px 16px; font-weight: 600; font-size: 13px; transition: .2s; border: 1px solid transparent; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-info.bg-animate-info {
    background: linear-gradient(315deg, #007fbf, #80daeb);
    background-size: 400% 400%; animation: gradient 10s ease infinite;
    color: #fff; text-transform: uppercase; font-size: 14px; letter-spacing: .4px;
}
.btn-info.bg-animate-info:hover { filter: brightness(1.07); transform: translateY(-1px); }
#login_button { height: 50px; }
.login-footer { text-align: center; color: rgba(255,255,255,.8); font-size: 12px; margin-top: 22px; }

/* --------------------------------------------------------------------------
   App shell — topbar
   -------------------------------------------------------------------------- */
.app-body { background: var(--bg); padding-top: var(--topbar-h); min-height: 100vh; }
.topbar {
    height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
    background: var(--topbar); background-image: url(../images/pattern.png); background-size: cover;
    color: #fff; padding: 0 16px; box-shadow: 0 1px 6px rgba(0,0,0,.15);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-logo { display: flex; align-items: center; height: var(--topbar-h); filter: brightness(0) invert(1); }
.button-menu-mobile { width: 44px; height: 44px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.button-menu-mobile span { width: 22px; height: 2px; background: #fff; display: block; transition: .25s; }
.button-menu-mobile.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.button-menu-mobile.open span:nth-child(2) { opacity: 0; }
.button-menu-mobile.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.app-search { display: flex; align-items: center; gap: 8px; height: 38px; width: 290px; padding: 0 12px; background: rgba(255,255,255,.1); border-radius: 6px; color: rgba(255,255,255,.8); }
.app-search .icon { width: 16px; height: 16px; }
.app-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 12.5px; }
.app-search input::placeholder { color: rgba(255,255,255,.55); }
.search-shortcut { font-size: 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 4px; padding: 2px 5px; color: rgba(255,255,255,.65); }
.top-icon { position: relative; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: rgba(255,255,255,.85); border-radius: 6px; }
.top-icon:hover { background: rgba(255,255,255,.12); color: #fff; }
.badge-dot { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--topbar); }
.top-dropdown { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 9px; background: transparent; border: 0; color: #fff; padding: 6px 8px; border-radius: 6px; }
.profile-btn:hover { background: rgba(255,255,255,.1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #80daeb); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.profile-name { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.profile-name strong { font-size: 12.5px; }
.profile-name small { font-size: 10.5px; color: rgba(255,255,255,.6); }
.icon.chevron { width: 14px; height: 14px; }
.dropdown-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 250px; background: var(--card); color: var(--text); border-radius: 9px; box-shadow: 0 12px 35px rgba(0,0,0,.2); border: 1px solid var(--border); padding: 6px; display: none; z-index: 1005; }
.dropdown-panel.open { display: block; }
.dropdown-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px; display: flex; flex-direction: column; gap: 2px; }
.dropdown-head strong { font-size: 14px; }
.dropdown-head small, .dropdown-head span { font-size: 11px; color: var(--muted); }
.dropdown-panel button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 12px; border-radius: 6px; color: var(--text); font-size: 13px; text-align: left; }
.dropdown-panel button:hover { background: var(--bg); }
.dropdown-panel button.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-foot { display: block; text-align: center; font-size: 12px; padding: 9px; border-top: 1px solid var(--border); margin-top: 4px; }
.notif-panel { width: 320px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 6px; }
.notif-item:hover { background: var(--bg); }
.notif-item .notif-ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.notif-ic .icon { width: 15px; height: 15px; }
.notif-ic.success { background: rgba(35,179,151,.14); color: var(--success); }
.notif-ic.warning { background: rgba(248,204,107,.2); color: #d39b18; }
.notif-ic.info { background: rgba(80,137,222,.14); color: var(--primary); }
.notif-item strong { display: block; font-size: 12.5px; }
.notif-item small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.left-side-menu {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
    background: #fff; border-right: 1px solid var(--border); z-index: 1000; display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.dark-mode .left-side-menu { background: #222a33; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 10px; }
.menu-label { font-size: 10px; letter-spacing: 1.2px; font-weight: 700; color: var(--muted); margin: 16px 12px 8px; }
.navigation-menu { list-style: none; margin: 0; padding: 0; }
.navigation-menu li { margin: 2px 0; }
.navigation-menu a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 7px;
    color: var(--text-soft); font-size: 13px; font-weight: 500; transition: .18s;
}
.navigation-menu a .icon { width: 17px; height: 17px; }
.navigation-menu a:hover { background: var(--bg); color: var(--primary); }
.navigation-menu a.active { background: rgba(80,137,222,.12); color: var(--primary); font-weight: 600; }
.navigation-menu a em { margin-left: auto; font-style: normal; font-size: 10px; background: var(--bg); border-radius: 10px; padding: 2px 7px; color: var(--muted); }
.navigation-menu a.active em { background: rgba(80,137,222,.18); color: var(--primary); }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.server-status { display: flex; align-items: center; gap: 10px; }
.server-status strong { display: block; font-size: 12px; }
.server-status small { display: block; font-size: 10.5px; color: var(--muted); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(35,179,151,.16); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(35,179,151,0); } }
.sidebar-overlay { display: none; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(65,77,95,.45); z-index: 999; }
body.sidebar-open .left-side-menu { transform: translateX(0); }

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.main-wrapper { margin-left: var(--sidebar-w); min-height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; }
.content-page { flex: 1; padding: 0 24px 30px; }
.page-title-box { background: var(--card); margin: 0 -24px 22px; padding: 0 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; min-height: 75px; gap: 14px; }
.page-title { font-size: 19px; font-weight: 600; margin: 0; color: var(--text); }
.breadcrumb { list-style: none; display: flex; gap: 7px; margin: 4px 0 0; padding: 0; font-size: 11px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 7px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #e5ebef; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; background: var(--bg); color: var(--text-soft); border: 1px solid var(--border); }
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }
.btn-icon .icon { width: 15px; height: 15px; }
.footer { background: linear-gradient(315deg, #3d454e, #5a6573); background-size: 400% 400%; animation: ftgradient 10s ease infinite; color: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; margin: 0; }
@keyframes ftgradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.footer-links a { color: #fff; margin-left: 18px; opacity: .82; }
.footer-links a:hover { opacity: 1; }

/* Cards, grids */
.card-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }
.card-panel .card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-panel .card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-panel .card-head small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-panel .card-inner { padding: 18px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1199px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card { position: relative; overflow: hidden; padding: 18px; display: flex; align-items: flex-start; justify-content: space-between; min-height: 118px; }
.stat-card .stat-label { font-size: 11.5px; color: var(--text-soft); font-weight: 500; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 3px; letter-spacing: -.5px; }
.stat-card .stat-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-icon.primary { background: rgba(80,137,222,.13); color: var(--primary); }
.stat-icon.success { background: rgba(35,179,151,.13); color: var(--success); }
.stat-icon.warning { background: rgba(248,204,107,.22); color: #d39b18; }
.stat-icon.danger { background: rgba(240,100,59,.13); color: var(--danger); }
.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

/* Charts */
.chart-wrap { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--text-soft); margin-top: 8px; flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.axis-label { fill: var(--muted); font-size: 10px; font-family: inherit; }
.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; font-size: 11.5px; }
.bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), #80daeb); transition: width .6s; }
.bar-fill.success { background: linear-gradient(90deg, var(--success), #6fd9bf); }
.bar-fill.warning { background: linear-gradient(90deg, #f0a93b, var(--warning)); }
.bar-row b { text-align: right; font-size: 11px; }
.donut-row { display: flex; align-items: center; gap: 20px; }
.donut { width: 128px; height: 128px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: var(--card); }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 21px; }
.donut-center small { font-size: 10px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; font-size: 12px; flex: 1; }
.donut-legend div { display: flex; justify-content: space-between; gap: 10px; }
.donut-legend i { font-style: normal; display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); }

/* Tables */
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-inline { position: relative; }
.search-inline .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-inline input { height: 36px; padding-left: 33px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); outline: none; min-width: 210px; }
.search-inline input:focus { border-color: var(--primary); }
.table-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-controls select { height: 36px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); padding: 0 8px; outline: none; }
.table-scroll { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { text-align: left; padding: 11px 14px; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--bg); white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.data-table tbody tr:hover { background: rgba(80,137,222,.04); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-title { font-weight: 600; }
.data-table .cell-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.data-table .actions { display: flex; gap: 5px; justify-content: flex-end; }
.data-table .actions .btn-icon { width: 28px; height: 28px; }
.empty-row td { text-align: center; padding: 38px 14px; color: var(--muted); }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); gap: 12px; flex-wrap: wrap; }
.pagination { display: flex; gap: 4px; }
.pagination button { min-width: 30px; height: 30px; border: 1px solid var(--border); background: var(--card); color: var(--text-soft); border-radius: 5px; font-size: 11.5px; }
.pagination button:hover:not(:disabled), .pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Badges & statuses */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: rgba(35,179,151,.13); color: #17987f; }
.badge.danger { background: rgba(240,100,59,.13); color: #d94f27; }
.badge.warning { background: rgba(248,204,107,.22); color: #b8860b; }
.badge.info { background: rgba(80,137,222,.13); color: var(--primary); }
.badge.secondary { background: var(--bg); color: var(--muted); }
.dark-mode .badge.success { color: #4fd2b5; }
.dark-mode .badge.danger { color: #ff8d6e; }
.dark-mode .badge.warning { color: var(--warning); }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 auto; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.progress-mini { width: 74px; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.progress-mini i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }

/* EPG */
.epg-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.epg-scroll { overflow-x: auto; }
.epg-grid { min-width: 980px; }
.epg-head, .epg-row { display: grid; grid-template-columns: 150px repeat(12, minmax(90px, 1fr)); }
.epg-head { background: var(--bg); position: sticky; top: 0; z-index: 2; }
.epg-head > div { padding: 9px 8px; font-size: 11px; font-weight: 600; color: var(--text-soft); text-align: center; border-bottom: 1px solid var(--border); }
.epg-head > div:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); z-index: 3; }
.epg-row { border-bottom: 1px solid var(--border); }
.epg-row:hover { background: rgba(80,137,222,.03); }
.epg-chan { display: flex; align-items: center; gap: 8px; padding: 8px; font-size: 12px; font-weight: 600; position: sticky; left: 0; background: var(--card); z-index: 1; border-right: 1px solid var(--border); }
.epg-chan .num { color: var(--muted); font-size: 10px; width: 18px; }
.epg-slot { padding: 5px 3px; border-right: 1px dashed var(--border); min-height: 52px; }
.epg-program { height: 100%; min-height: 42px; border-radius: 5px; padding: 6px 8px; font-size: 11px; overflow: hidden; cursor: pointer; border-left: 3px solid var(--primary); background: rgba(80,137,222,.09); transition: .15s; }
.epg-program:hover { filter: brightness(.96); transform: translateY(-1px); }
.epg-program strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-program small { color: var(--text-soft); font-size: 10px; }
.epg-program.cat-filme { border-color: var(--success); background: rgba(35,179,151,.1); }
.epg-program.cat-show { border-color: var(--warning); background: rgba(248,204,107,.16); }
.epg-program.cat-sport { border-color: var(--danger); background: rgba(240,100,59,.1); }
.epg-program.cat-news { border-color: var(--info); background: rgba(86,194,214,.12); }

/* Settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 13px 15px; color: var(--text-soft); font-size: 12.5px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.tab-pane { display: none; padding: 20px; }
.tab-pane.active { display: block; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.form-field .hint { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.form-field select, .form-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--text); padding: 10px 12px; outline: none; }
.form-field textarea { min-height: 90px; resize: vertical; }
.form-field select:focus, .form-field textarea:focus { border-color: var(--primary); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.switch strong { display: block; font-size: 12.5px; }
.switch small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.switch input { display: none; }
.switch label { width: 40px; height: 22px; border-radius: 12px; background: #cfd8de; position: relative; cursor: pointer; transition: .2s; flex: 0 0 auto; }
.switch label::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + label { background: var(--primary); }
.switch input:checked + label::after { transform: translateX(18px); }
.form-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 4px 0 12px; }

/* Timeline / activity */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-ic { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; background: rgba(80,137,222,.12); color: var(--primary); }
.timeline .tl-ic .icon { width: 14px; height: 14px; }
.timeline strong { font-size: 12.5px; }
.timeline small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* Media cards */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.media-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); transition: .2s; }
.media-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(65,77,95,.14); }
.media-thumb { height: 108px; display: grid; place-items: center; color: #fff; position: relative; }
.media-thumb .icon { width: 34px; height: 34px; opacity: .9; }
.media-thumb .badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.45); color: #fff; }
.media-thumb .badge::before { display: none; }
.media-body { padding: 12px; }
.media-body strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-body small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.media-actions { display: flex; gap: 6px; margin-top: 10px; }

/* Modal */
.modal-root { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-root.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(33, 42, 52, .6); backdrop-filter: blur(2px); }
.modal-dialog { position: relative; background: var(--card); border-radius: 12px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 25px 70px rgba(0,0,0,.3); animation: modalIn .18s ease-out; }
.modal-dialog.wide { max-width: 760px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg); }
.modal-close { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.modal-close:hover { background: var(--bg); color: var(--danger); }

/* Toast */
#toastRoot { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 9px; }
.toast { background: var(--card); border-left: 4px solid var(--primary); box-shadow: 0 8px 25px rgba(0,0,0,.16); border-radius: 7px; padding: 12px 16px; min-width: 260px; max-width: 360px; display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; animation: toastIn .22s ease-out; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(25px); } }
.toast.out { opacity: 0; transform: translateX(25px); transition: .25s; }

/* Preloader */
#preloader { position: fixed; inset: 0; background: var(--card); z-index: 9999; transition: opacity .3s; }
#preloader.hide { opacity: 0; pointer-events: none; }
#status { width: 40px; height: 40px; position: absolute; left: 50%; top: 50%; margin: -20px 0 0 -20px; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-left-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }

/* Responsive */
@media (max-width: 991px) {
    .left-side-menu { transform: translateX(-100%); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .main-wrapper { margin-left: 0; }
    .profile-name, .search-shortcut { display: none; }
    .app-search { width: 200px; }
}
@media (max-width: 767px) {
    :root { --topbar-h: 62px; }
    .app-search { display: none; }
    .content-page { padding: 0 14px 24px; }
    .page-title-box { margin: 0 -14px 18px; padding: 12px 14px; min-height: 68px; }
    .page-title { font-size: 16px; }
    .footer { padding: 12px 14px; flex-direction: column; gap: 6px; text-align: center; }
    .footer-links a { margin: 0 8px; }
    .topbar-logo img { height: 28px; }
    .notif-panel { width: min(320px, calc(100vw - 20px)); right: -70px; }
}
