/* User-center pages — aligns with home / auth / admin atmospheric system */
:root {
    --uc-ink: #15261a;
    --uc-forest: #205A28;
    --uc-forest-deep: #163f1c;
    --uc-sage: #4a7a52;
    --uc-mist: #e8eee8;
    --uc-paper: #f6f7f4;
    --uc-line: rgba(21, 38, 26, 0.12);
    --uc-gold: #b08d3e;
    --uc-danger: #9b2c2c;
    --uc-ok: #1f6b3a;
    --uc-warn: #8a6d2e;
    --uc-font-display: "Literata", "Noto Serif SC", "Songti SC", Georgia, serif;
    --uc-font-ui: "Manrope", "Noto Sans SC", "PingFang SC", "Segoe UI", sans-serif;
    --uc-content-max: 1120px;
}

@keyframes ucFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ucDrift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0.8%, -0.5%, 0) scale(1.015); }
}

@media (prefers-reduced-motion: reduce) {
    .uc-page *,
    .uc-page *::before,
    .uc-page *::after,
    body:has(.uc-shell) *,
    body:has(.uc-shell) *::before,
    body:has(.uc-shell) *::after {
        animation: none !important;
        transition: none !important;
    }
}

body.uc-page,
body:has(.uc-shell) {
    background: var(--uc-paper);
    font-family: var(--uc-font-ui);
    color: var(--uc-ink);
}

body.uc-page .main-content,
.uc-shell > .main-content,
.uc-body {
    padding-top: 1.5rem;
    padding-bottom: 2.75rem;
}

/* —— Compact atmospheric hero —— */
.uc-hero {
    position: relative;
    overflow: hidden;
    color: #f4f7f4;
    background:
        linear-gradient(155deg, rgba(22, 63, 28, 0.94) 0%, rgba(21, 38, 26, 0.9) 55%, rgba(32, 90, 40, 0.88) 100%),
        radial-gradient(80% 70% at 92% 0%, rgba(176, 141, 62, 0.2), transparent 52%),
        linear-gradient(135deg, #1a3d22 0%, #0f1f14 100%);
    padding: 1.35rem 0 1.5rem;
    animation: ucFadeUp 0.45s ease both;
}

.uc-hero::before {
    content: "";
    position: absolute;
    inset: -6%;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 44px,
            rgba(255, 255, 255, 0.03) 44px,
            rgba(255, 255, 255, 0.03) 48px,
            transparent 48px,
            transparent 80px,
            rgba(176, 141, 62, 0.06) 80px,
            rgba(176, 141, 62, 0.06) 84px
        );
    animation: ucDrift 24s ease-in-out infinite;
    pointer-events: none;
}

.uc-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 12% 90%, rgba(255, 255, 255, 0.05), transparent 55%),
        linear-gradient(180deg, transparent 60%, rgba(8, 16, 10, 0.22) 100%);
    pointer-events: none;
}

.uc-hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--uc-content-max);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.uc-hero-text {
    min-width: 0;
    flex: 1 1 16rem;
}

.uc-hero-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 247, 244, 0.62);
    margin: 0 0 0.45rem;
}

.uc-hero .uc-hero-title,
.uc-page .uc-hero-title,
.uc-shell .uc-hero-title {
    font-family: var(--uc-font-display);
    font-size: clamp(1.45rem, 2.6vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.uc-hero .uc-hero-title i,
.uc-page .uc-hero-title i,
.uc-shell .uc-hero-title i {
    margin-right: 0.35rem;
    opacity: 0.85;
    font-size: 0.92em;
    color: inherit;
}

.uc-hero-support {
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(244, 247, 244, 0.72);
    margin: 0.45rem 0 0;
    max-width: 36rem;
}

.uc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.uc-hero-actions .btn {
    border-radius: 0;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 0.95rem;
}

.uc-hero-actions .btn-light,
.uc-hero-actions .btn-primary {
    background: #fff;
    color: var(--uc-forest-deep);
    border-color: #fff;
}

.uc-hero-actions .btn-light:hover,
.uc-hero-actions .btn-primary:hover {
    background: var(--uc-mist);
    color: var(--uc-ink);
    border-color: var(--uc-mist);
}

.uc-hero-actions .btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    background: transparent;
}

.uc-hero-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: #fff;
}

.uc-hero-actions .btn-outline-danger {
    color: #ffd4d4;
    border-color: rgba(255, 180, 180, 0.55);
    background: transparent;
}

.uc-hero-actions .btn-outline-danger:hover {
    background: rgba(155, 44, 44, 0.35);
    color: #fff;
    border-color: #ffd4d4;
}

/* —— Content shell —— */
.uc-body,
.uc-shell .container.main-content,
.uc-page .container.main-content {
    max-width: var(--uc-content-max);
    animation: ucFadeUp 0.5s 0.06s ease both;
}

.uc-body > .container,
.uc-shell .container {
    max-width: var(--uc-content-max);
}

/* —— Typography —— */
.uc-page h1, .uc-page .h1,
.uc-page h2, .uc-page .h2,
.uc-shell h1, .uc-shell .h1,
.uc-shell h2, .uc-shell .h2,
.uc-body h1, .uc-body .h1,
.uc-body h2, .uc-body .h2 {
    font-family: var(--uc-font-display);
    font-weight: 600;
    color: var(--uc-ink);
    letter-spacing: -0.02em;
}

.uc-page h5, .uc-page .card-title,
.uc-shell h5, .uc-shell .card-title,
.uc-body h5, .uc-body .card-title {
    font-family: var(--uc-font-display);
    font-weight: 600;
    color: var(--uc-ink);
}

.uc-section-title {
    font-family: var(--uc-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--uc-ink);
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

/* —— Cards —— */
.uc-page .card,
.uc-shell .card,
.uc-body .card {
    border: 1px solid var(--uc-line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff;
    color: var(--uc-ink);
}

.uc-page .card-header,
.uc-shell .card-header,
.uc-body .card-header {
    background: rgba(32, 90, 40, 0.03);
    border-bottom: 1px solid var(--uc-line);
    border-radius: 0 !important;
    font-family: var(--uc-font-display);
    font-weight: 600;
}

.uc-page .shadow,
.uc-page .shadow-sm,
.uc-shell .shadow,
.uc-shell .shadow-sm,
.uc-body .shadow,
.uc-body .shadow-sm {
    box-shadow: none !important;
}

/* Metric / stats cards */
.uc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.uc-stat {
    background: #fff;
    border: 1px solid var(--uc-line);
    border-top: 3px solid var(--uc-forest);
    padding: 1.1rem 1rem;
    text-align: center;
}

.uc-stat--sage { border-top-color: var(--uc-sage); }
.uc-stat--gold { border-top-color: var(--uc-gold); }
.uc-stat--ink { border-top-color: var(--uc-ink); }
.uc-stat--ok { border-top-color: var(--uc-ok); }

.uc-stat-value {
    font-family: var(--uc-font-display);
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 600;
    color: var(--uc-ink);
    line-height: 1.15;
    margin: 0 0 0.25rem;
}

.uc-stat-label {
    font-size: 0.8rem;
    color: rgba(21, 38, 26, 0.55);
    margin: 0;
    letter-spacing: 0.02em;
}

.uc-stat-icon {
    display: block;
    font-size: 1.15rem;
    color: var(--uc-sage);
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

/* Legacy gradient stats → atmospheric */
.uc-page .stats-card,
.uc-shell .stats-card,
.uc-body .stats-card,
.uc-page .stat-card,
.uc-shell .stat-card,
.uc-body .stat-card {
    background: #fff !important;
    color: var(--uc-ink) !important;
    border: 1px solid var(--uc-line) !important;
    border-top: 3px solid var(--uc-forest) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.uc-page .stat-card.secondary,
.uc-body .stat-card.secondary { border-top-color: var(--uc-sage) !important; }
.uc-page .stat-card.info,
.uc-body .stat-card.info { border-top-color: var(--uc-sage) !important; }
.uc-page .stat-card.warning,
.uc-body .stat-card.warning { border-top-color: var(--uc-gold) !important; }
.uc-page .stat-card.success,
.uc-body .stat-card.success { border-top-color: var(--uc-ok) !important; }

.uc-page .stats-card .display-4,
.uc-page .stat-card .display-4,
.uc-shell .stats-card .display-4,
.uc-body .stats-card .display-4 {
    font-size: 1.35rem !important;
    color: var(--uc-sage) !important;
    opacity: 0.9;
}

.uc-page .stats-card h2,
.uc-page .stat-card h3,
.uc-shell .stats-card h2,
.uc-body .stat-card h3 {
    font-family: var(--uc-font-display);
    color: var(--uc-ink) !important;
}

.uc-page .stats-card .card-title,
.uc-page .stat-card p,
.uc-shell .stats-card .card-title,
.uc-body .stat-card p {
    color: rgba(21, 38, 26, 0.55) !important;
    opacity: 1 !important;
    font-size: 0.85rem;
}

/* —— Filters / pills —— */
.uc-page .nav-pills .nav-link,
.uc-shell .nav-pills .nav-link,
.uc-body .nav-pills .nav-link {
    border-radius: 0;
    color: rgba(21, 38, 26, 0.62);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.95rem;
    border-bottom: 2px solid transparent;
    background: transparent;
}

.uc-page .nav-pills .nav-link:hover,
.uc-shell .nav-pills .nav-link:hover,
.uc-body .nav-pills .nav-link:hover {
    color: var(--uc-forest);
    background: rgba(32, 90, 40, 0.04);
}

.uc-page .nav-pills .nav-link.active,
.uc-shell .nav-pills .nav-link.active,
.uc-body .nav-pills .nav-link.active {
    background: transparent;
    color: var(--uc-forest);
    border-bottom-color: var(--uc-forest);
    font-weight: 600;
}

/* —— List groups —— */
.uc-page .list-group-item,
.uc-shell .list-group-item,
.uc-body .list-group-item {
    border-color: var(--uc-line);
    border-radius: 0 !important;
    padding: 1rem 1.1rem;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.uc-page .list-group-item:hover,
.uc-shell .list-group-item:hover,
.uc-body .list-group-item:hover {
    background: rgba(32, 90, 40, 0.03);
}

.uc-page .list-group-item.bg-light,
.uc-shell .list-group-item.bg-light,
.uc-body .list-group-item.bg-light {
    background: rgba(32, 90, 40, 0.05) !important;
    border-left: 3px solid var(--uc-forest);
}

.uc-page a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item),
.uc-shell a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item),
.uc-body a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
    color: var(--uc-forest);
}

.uc-page a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):hover,
.uc-shell a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):hover,
.uc-body a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):hover {
    color: var(--uc-forest-deep);
}

/* —— Buttons —— */
.uc-page .btn,
.uc-shell .btn,
.uc-body .btn {
    border-radius: 0;
    font-weight: 550;
}

.uc-page .btn-primary,
.uc-shell .btn-primary,
.uc-body .btn-primary {
    background: var(--uc-forest);
    border-color: var(--uc-forest);
}

.uc-page .btn-primary:hover,
.uc-shell .btn-primary:hover,
.uc-body .btn-primary:hover {
    background: var(--uc-forest-deep);
    border-color: var(--uc-forest-deep);
}

.uc-page .btn-outline-primary,
.uc-shell .btn-outline-primary,
.uc-body .btn-outline-primary {
    color: var(--uc-forest);
    border-color: var(--uc-forest);
}

.uc-page .btn-outline-primary:hover,
.uc-shell .btn-outline-primary:hover,
.uc-body .btn-outline-primary:hover {
    background: var(--uc-forest);
    border-color: var(--uc-forest);
    color: #fff;
}

.uc-page .btn-outline-secondary,
.uc-shell .btn-outline-secondary,
.uc-body .btn-outline-secondary {
    color: rgba(21, 38, 26, 0.7);
    border-color: var(--uc-line);
}

.uc-page .btn-outline-secondary:hover,
.uc-shell .btn-outline-secondary:hover,
.uc-body .btn-outline-secondary:hover {
    background: rgba(32, 90, 40, 0.06);
    color: var(--uc-ink);
    border-color: rgba(32, 90, 40, 0.25);
}

.uc-page .btn-outline-danger,
.uc-shell .btn-outline-danger,
.uc-body .btn-outline-danger {
    color: var(--uc-danger);
    border-color: rgba(155, 44, 44, 0.35);
}

.uc-page .text-primary,
.uc-shell .text-primary,
.uc-body .text-primary {
    color: var(--uc-forest) !important;
}

/* —— Badges —— */
.uc-page .badge.bg-primary,
.uc-shell .badge.bg-primary,
.uc-body .badge.bg-primary {
    background: var(--uc-forest) !important;
}

.uc-page .badge.bg-secondary,
.uc-shell .badge.bg-secondary,
.uc-body .badge.bg-secondary {
    background: rgba(21, 38, 26, 0.45) !important;
}

.uc-page .badge.bg-success,
.uc-shell .badge.bg-success,
.uc-body .badge.bg-success {
    background: var(--uc-ok) !important;
}

.uc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--uc-ink);
    background: #fff;
    border: 1px solid var(--uc-line);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.uc-chip:hover {
    border-color: rgba(32, 90, 40, 0.35);
    background: rgba(32, 90, 40, 0.04);
}

.uc-chip--accent {
    border-color: rgba(32, 90, 40, 0.28);
    background: rgba(32, 90, 40, 0.06);
    color: var(--uc-forest);
}

/* —— Pagination —— */
.uc-page .pagination .page-link,
.uc-shell .pagination .page-link,
.uc-body .pagination .page-link {
    border-radius: 0;
    color: var(--uc-forest);
    border-color: var(--uc-line);
    font-weight: 500;
}

.uc-page .pagination .page-item.active .page-link,
.uc-shell .pagination .page-item.active .page-link,
.uc-body .pagination .page-item.active .page-link {
    background: var(--uc-forest);
    border-color: var(--uc-forest);
    color: #fff;
}

.uc-page .pagination .page-link:hover,
.uc-shell .pagination .page-link:hover,
.uc-body .pagination .page-link:hover {
    background: rgba(32, 90, 40, 0.06);
    color: var(--uc-forest-deep);
}

/* —— Empty state —— */
.uc-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: #fff;
    border: 1px solid var(--uc-line);
}

.uc-empty i {
    font-size: 3rem;
    color: var(--uc-sage);
    opacity: 0.55;
}

.uc-empty p {
    margin: 1rem 0 0;
    color: rgba(21, 38, 26, 0.55);
}

.uc-empty .btn {
    margin-top: 1.25rem;
}

/* —— Tables —— */
.uc-page .table,
.uc-shell .table,
.uc-body .table {
    --bs-table-bg: #fff;
    border-color: var(--uc-line);
}

.uc-page .table thead th,
.uc-shell .table thead th,
.uc-body .table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(21, 38, 26, 0.5);
    border-bottom-color: var(--uc-line);
    background: rgba(32, 90, 40, 0.03);
}

.uc-page .table tbody tr:hover,
.uc-shell .table tbody tr:hover,
.uc-body .table tbody tr:hover {
    background: rgba(32, 90, 40, 0.03);
}

/* —— Alerts —— */
.uc-page .alert,
.uc-shell .alert,
.uc-body .alert {
    border-radius: 0;
    border-width: 1px;
}

.uc-page .alert-success,
.uc-shell .alert-success,
.uc-body .alert-success {
    background: rgba(31, 107, 58, 0.08);
    border-color: rgba(31, 107, 58, 0.25);
    color: var(--uc-ok);
}

.uc-page .alert-danger,
.uc-shell .alert-danger,
.uc-body .alert-danger {
    background: rgba(155, 44, 44, 0.08);
    border-color: rgba(155, 44, 44, 0.25);
    color: var(--uc-danger);
}

/* —— Progress —— */
.uc-page .progress-fill,
.uc-page .progress-fill-custom,
.uc-shell .progress-fill,
.uc-body .progress-fill,
.uc-body .progress-fill-custom {
    background: linear-gradient(90deg, var(--uc-forest) 0%, var(--uc-sage) 100%);
}

/* —— Cover thumbs —— */
.uc-page .ebook-cover-small,
.uc-shell .ebook-cover-small,
.uc-body .ebook-cover-small {
    border-radius: 0;
    border: 1px solid var(--uc-line);
    background: var(--uc-mist);
}

/* —— Toolbar row (title replaced by hero) —— */
.uc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* —— Panel block —— */
.uc-panel {
    background: #fff;
    border: 1px solid var(--uc-line);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
}

.uc-panel-title {
    font-family: var(--uc-font-display);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--uc-ink);
}

@media (max-width: 576px) {
    .uc-hero {
        padding: 1.1rem 0 1.25rem;
    }

    .uc-hero-actions {
        width: 100%;
    }

    .uc-hero-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
