:root {
    color-scheme: light;
    --app-bg: #f6f8fb;
    --app-card: #ffffff;
    --app-border: #e5e7eb;
    --app-text: #0f172a;
    --app-muted: #6b7280;
    --app-primary: #0d6efd;
    --app-accent: #0ea5e9;
    --app-info: #17a2b8;
    --app-success: #28a745;
    --app-warning: #f0ad4e;
    --app-danger: #dc3545;
    --app-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --app-shadow-soft: 0 18px 44px rgba(13, 110, 253, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.07), transparent 24%),
        radial-gradient(circle at 82% 0%, rgba(14, 165, 233, 0.08), transparent 25%),
        var(--app-bg);
    color: var(--app-text);
}

a {
    color: var(--app-primary);
}

.app-header {
    background: var(--app-card);
    border-bottom: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-brand {
    font-weight: 700;
    letter-spacing: 0.4px;
}

.app-tag {
    background: rgba(13, 165, 253, 0.12);
    color: var(--app-primary);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.app-shell {
    max-width: 1200px;
}

.app-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(13, 110, 253, 0.18);
    background: #e5e7eb;
}

.app-user {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.app-user:hover {
    background: rgba(13, 110, 253, 0.1);
}

.app-card {
    background: var(--app-card);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-card:hover {
    box-shadow: var(--app-shadow-soft);
    transform: translateY(-2px);
}

.app-section {
    margin-bottom: 1.5rem;
}

.app-section-title {
    margin: 0;
    font-weight: 700;
}

.app-toolbar {
    background: var(--app-card);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    padding: 12px 16px;
}

.muted {
    color: var(--app-muted) !important;
}

.title {
    margin: 0 0 6px;
}

.table > :not(caption) > * > * {
    padding: 12px 10px;
    background-color: transparent;
    border-bottom: 1px solid var(--app-border);
}

.table thead th {
    color: var(--app-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.table-hover tbody tr:hover {
    background: rgba(13, 110, 253, 0.06);
}

.table-card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    overflow: hidden;
}

.table-card table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.table-card table tbody tr:hover {
    background: rgba(13, 110, 253, 0.06);
    transform: translateY(-1px);
}

.table-card table tbody tr.active-row {
    background: rgba(13, 110, 253, 0.14);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pill.pending {
    background: rgba(13, 110, 253, 0.15);
    color: var(--app-primary);
}

.pill.progress {
    background: rgba(23, 162, 184, 0.2);
    color: var(--app-info);
}

.pill.done {
    background: rgba(40, 167, 69, 0.18);
    color: var(--app-success);
}

.pill.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--app-danger);
}

.status-msg {
    font-size: 13px;
    color: var(--app-muted);
}

.status-msg.error {
    color: var(--app-danger);
}

.status-msg.success {
    color: var(--app-success);
}

.app-info-box {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    padding: 16px;
    min-height: 120px;
}

.app-info-box .icon {
    position: absolute;
    right: 16px;
    bottom: 10px;
    font-size: 40px;
    opacity: 0.2;
}

.app-info-box.primary {
    background: linear-gradient(135deg, #0d6efd, #4a7dff);
}

.app-info-box.info {
    background: linear-gradient(135deg, #17a2b8, #4dbad0);
}

.app-info-box.success {
    background: linear-gradient(135deg, #1ea866, #3fc487);
}

.app-info-box.warning {
    background: linear-gradient(135deg, #f59e0b, #f6b347);
}

.app-info-box.danger {
    background: linear-gradient(135deg, #dc3545, #f06f7e);
}

.app-info-box small {
    color: rgba(255, 255, 255, 0.85);
}

.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1050;
}

.app-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shadow);
    width: 100%;
    max-width: 1080px;
    max-height: 90vh;
    overflow: auto;
    padding: 22px;
}

.app-modal header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.app-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.15);
    color: var(--app-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(13, 110, 253, 0.08);
    color: var(--app-primary);
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

.home-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--app-border);
    background: linear-gradient(135deg, #e9f1ff, #f3fbff);
}

.home-hero::after,
.home-hero::before {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(16px);
    opacity: 0.5;
}

.home-hero::before {
    width: 220px;
    height: 220px;
    background: rgba(13, 110, 253, 0.18);
    top: -40px;
    right: -60px;
}

.home-hero::after {
    width: 160px;
    height: 160px;
    background: rgba(14, 165, 233, 0.18);
    bottom: -60px;
    left: -40px;
}

.home-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--app-primary);
    font-weight: 600;
}

.floating-search {
    position: sticky;
    top: 76px;
    z-index: 900;
    border: 1px solid var(--app-border);
    background: linear-gradient(135deg, #eef4ff, #f7fbff);
    box-shadow: var(--app-shadow);
}

.floating-search .app-input {
    background: #fff;
    border-color: var(--app-border);
}

.search-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.12);
    color: var(--app-primary);
    display: grid;
    place-items: center;
}

.home-hero-stats .stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    padding: 14px 16px;
    min-width: 160px;
    box-shadow: var(--app-shadow);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--app-text);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.chip.small {
    padding: 5px 10px;
    font-size: 12px;
}

.chip.neutral {
    background: rgba(13, 110, 253, 0.12);
    color: var(--app-primary);
}

.chip.outline {
    border: 1px dashed var(--app-border);
    color: var(--app-muted);
}

.app-input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--app-border);
}

.app-grid {
    display: grid;
    gap: 12px;
}

.app-grid.two-cols {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.app-grid.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.app-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(13, 110, 253, 0.2);
    background: #e5e7eb;
}

.avatar-soft {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.14), rgba(14, 165, 233, 0.18));
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.sidebar-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.link-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--app-text);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.link-tile .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--app-primary);
    display: grid;
    place-items: center;
}

.link-tile:hover {
    border-color: rgba(13, 110, 253, 0.5);
    transform: translateY(-1px);
    box-shadow: var(--app-shadow);
}

.separator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--app-border);
}

.pagination .page-link {
    border-radius: 8px;
    border-color: var(--app-border);
    color: var(--app-text);
}

.pagination .page-link.active,
.pagination .page-item.active .page-link {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
}

.app-scroll-card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    overflow: hidden;
}

.news-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--app-border);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.news-card:hover {
    box-shadow: var(--app-shadow-soft);
}

.news-card-head {
    border-bottom: 1px solid var(--app-border);
}

.news-card .news-image img {
    max-height: 320px;
    object-fit: cover;
}

.news-card .news-status {
    min-height: 18px;
}

.news-layout {
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 18px;
}

.news-body {
    min-width: 0;
}

.news-thumb-sm {
    width: 240px;
    height: 220px;
    flex: 0 0 240px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.04), rgba(255, 255, 255, 0.95));
}

.news-thumb-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.news-html {
    line-height: 1.5;
}

.news-snippet {
    position: relative;
    max-height: 220px;
    min-height: 140px;
    overflow: hidden;
}

.news-snippet::after {
    content: '...';
    position: absolute;
    right: 0;
    bottom: 0;
    padding-left: 12px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, var(--app-card) 60%);
}

.news-html p {
    margin-bottom: 0.5rem;
}

.news-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--app-border);
}

.news-viewer-image img {
    border-radius: 14px;
    object-fit: cover;
    box-shadow: var(--app-shadow);
}

.app-modal-wide {
    max-width: 960px;
    width: 95%;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-richtext .ql-editor {
    min-height: 160px;
}

@media (max-width: 768px) {
    .news-layout {
        flex-wrap: wrap;
    }
    .news-thumb-sm {
        width: 100%;
        max-width: 100%;
        height: 220px;
        flex: 1 1 100%;
    }
    .news-snippet {
        height: auto;
        max-height: none;
    }
    .news-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .home-hero-stats {
        width: 100%;
    }
    .home-hero-stats .stat-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .app-header .container-fluid {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
