:root {
    --cs-primary: #8c2230;
    --cs-primary-dark: #651821;
    --cs-secondary: #1e293b;
    --cs-accent: #c8a968;
    --cs-bg: #f6f1e8;
    --cs-bg-soft: #fbf8f3;
    --cs-surface: rgba(255,255,255,.88);
    --cs-surface-strong: #ffffff;
    --cs-text: #1f2937;
    --cs-muted: #6b7280;
    --cs-border: rgba(140, 34, 48, 0.12);
    --cs-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --cs-shadow-soft: 0 10px 22px rgba(15, 23, 42, 0.06);
    --cs-radius: 1.15rem;
}

html, body {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(140, 34, 48, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(200, 169, 104, 0.12), transparent 24%),
        var(--cs-bg);
    color: var(--cs-text);
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

img { max-width: 100%; }
a { text-decoration: none; }

.premium-shell {
    display: flex;
    min-height: 100vh;
}

.premium-sidebar {
    width: 290px;
    background: linear-gradient(180deg, rgba(18, 24, 32, 0.98), rgba(29, 36, 46, 0.96));
    color: #fff;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18);
    z-index: 1040;
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: #fff;
}

.sidebar-logo {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 1rem;
    background: rgba(255,255,255,.12);
    padding: .2rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.sidebar-brand-link strong {
    display: block;
    font-size: 1rem;
    letter-spacing: .02em;
}

.sidebar-brand-link span {
    display: block;
    font-size: .8rem;
    color: rgba(255,255,255,.7);
}

.sidebar-section-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    margin-top: .5rem;
}

.sidebar-nav {
    display: grid;
    gap: .35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: rgba(255,255,255,.82);
    padding: .92rem 1rem;
    border-radius: 1rem;
    transition: all .2s ease;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(140, 34, 48, 0.92), rgba(101, 24, 33, 0.92));
    transform: translateX(4px);
    box-shadow: 0 12px 26px rgba(140, 34, 48, .22);
}

.sidebar-footer-card {
    margin-top: auto;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.55);
    margin-bottom: .35rem;
}

.sidebar-footer-card strong {
    display: block;
    margin-bottom: .25rem;
}

.sidebar-footer-card small {
    color: rgba(255,255,255,.72);
}

.sidebar-close,
.sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: .95rem;
    border: 0;
    background: rgba(255,255,255,.1);
    color: #fff;
}

.premium-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid rgba(140, 34, 48, 0.08);
    backdrop-filter: blur(16px);
    background: rgba(255,255,255,.55);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.topbar-kicker {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--cs-primary);
    font-weight: 700;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.topbar-profile {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--cs-text);
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(140, 34, 48, 0.12);
    padding: .45rem .65rem;
    border-radius: 999px;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-primary-dark));
    color: #fff;
    font-weight: 700;
}

.app-shell {
    padding: 1.35rem;
}

.alert-soft {
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--cs-shadow-soft);
}

.page-header-card,
.hero-dashboard {
    background:
        linear-gradient(135deg, rgba(140,34,48,.95), rgba(101,24,33,.92)),
        linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0));
    border: 0;
    border-radius: 1.6rem;
    color: #fff;
    box-shadow: 0 18px 42px rgba(140, 34, 48, 0.18);
    overflow: hidden;
    position: relative;
}

.page-header-card::before,
.hero-dashboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 24%);
    pointer-events: none;
}

.page-header-card .card-body,
.hero-dashboard {
    padding: 1.5rem;
}

.page-title,
.hero-title {
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
    margin-bottom: .35rem;
}

.page-subtitle,
.hero-subtitle {
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: .98rem;
    max-width: 62ch;
}

.section-title {
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--cs-text);
    margin-bottom: 1rem;
}

.soft-card,
.summary-card,
.quick-card,
.module-card,
.mobile-animal-card,
.detail-card,
.stat-card {
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--cs-radius);
    background: var(--cs-surface);
    backdrop-filter: blur(12px);
    box-shadow: var(--cs-shadow-soft);
}

.soft-card .card-body,
.summary-card .card-body,
.quick-card .card-body,
.module-card .card-body,
.mobile-animal-card .card-body,
.detail-card .card-body,
.stat-card .card-body {
    padding: 1rem;
}

.module-card,
.summary-card,
.quick-card,
.stat-card {
    height: 100%;
}

.module-card,
.quick-card,
.stat-card,
.soft-card {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.module-card:hover,
.quick-card:hover,
.stat-card:hover,
.soft-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cs-shadow);
    border-color: rgba(140, 34, 48, .18);
}

.module-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.icon-green {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.icon-blue {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.icon-orange {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.module-title {
    font-size: 1.06rem;
    font-weight: 800;
    margin-bottom: .45rem;
}

.module-text,
.help-text,
.summary-label,
.quick-label,
.mobile-animal-subtitle,
.mobile-info-label,
.stat-label {
    color: var(--cs-muted);
}

.module-text {
    font-size: .95rem;
    margin-bottom: 1rem;
    min-height: 52px;
}

.btn-module,
.btn-rounded,
.search-btn,
.search-input,
.action-btn,
.btn {
    border-radius: .95rem;
}

.btn-success {
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-primary-dark));
    border-color: transparent;
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, #9c2838, #741a26);
    border-color: transparent;
}

.btn-light {
    background: rgba(255,255,255,.94);
    border-color: rgba(255,255,255,.35);
}

.btn-outline-primary {
    color: var(--cs-primary);
    border-color: rgba(140, 34, 48, .24);
}

.btn-outline-primary:hover {
    background: var(--cs-primary);
    border-color: var(--cs-primary);
}

.btn-module,
.btn-rounded,
.action-btn {
    min-height: 46px;
    font-weight: 700;
}

.btn-module {
    width: 100%;
    padding: .82rem 1rem;
}

.quick-card .card-body,
.summary-card .card-body,
.stat-card .card-body {
    padding: 1.05rem 1.1rem;
}

.quick-label,
.summary-label,
.stat-label {
    font-size: .8rem;
    margin-bottom: .25rem;
}

.quick-value,
.summary-value,
.stat-value {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.form-label {
    font-weight: 700;
    color: #374151;
    margin-bottom: .45rem;
}

.form-control,
.form-select {
    border-radius: .95rem;
    min-height: 48px;
    border: 1px solid rgba(140, 34, 48, 0.1);
    background: rgba(255,255,255,.92);
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(140, 34, 48, 0.12);
    border-color: rgba(140, 34, 48, 0.34);
}

textarea.form-control { min-height: 110px; }

.animal-table thead th {
    border-bottom: 0;
    background: rgba(140, 34, 48, 0.06);
    color: #4b5563;
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
}

.animal-table td,
.animal-table th {
    vertical-align: middle;
    padding: .95rem;
}

.animal-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(140, 34, 48, .1);
    background: #fff;
}

.animal-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    border: 1px dashed rgba(140, 34, 48, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--cs-muted);
    background: rgba(255,255,255,.65);
    text-align: center;
    padding: .25rem;
}

.badge-soft-success,
.badge-soft-secondary,
.badge-soft-warning,
.badge-soft-primary,
.badge-soft-danger {
    font-weight: 700;
    padding: .5rem .7rem;
    border-radius: .8rem;
}

.badge-soft-success { background: rgba(16,185,129,.12); color: #059669; }
.badge-soft-secondary { background: rgba(107,114,128,.14); color: #6b7280; }
.badge-soft-warning { background: rgba(245,158,11,.16); color: #b45309; }
.badge-soft-primary { background: rgba(59,130,246,.14); color: #2563eb; }
.badge-soft-danger { background: rgba(239,68,68,.14); color: #dc2626; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    z-index: 1030;
}

.sidebar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.auth-premium {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: linear-gradient(135deg, rgba(140,34,48,.08), rgba(101,24,33,.02));
}

.auth-showcase {
    padding: clamp(2rem, 4vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-showcase-card {
    max-width: 560px;
    color: var(--cs-secondary);
}

.auth-logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-logo-wrap img {
    width: 78px;
    height: 78px;
    border-radius: 1.35rem;
    object-fit: cover;
    box-shadow: var(--cs-shadow);
}

.auth-kicker {
    display: inline-block;
    margin-bottom: .8rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: rgba(140,34,48,.08);
    color: var(--cs-primary);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    font-weight: 800;
    margin-bottom: 1rem;
}

.auth-text {
    color: var(--cs-muted);
    font-size: 1rem;
    margin-bottom: 1.4rem;
}

.auth-bullets {
    display: grid;
    gap: .85rem;
}

.auth-bullet {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--cs-secondary);
    font-weight: 600;
}

.auth-bullet i {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(140,34,48,.1);
    color: var(--cs-primary);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-panel-inner {
    width: 100%;
    max-width: 460px;
    padding: 1.5rem;
    border-radius: 1.6rem;
    background: rgba(255,255,255,.88);
    box-shadow: 0 24px 54px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.55);
}

@media (max-width: 991.98px) {
    .premium-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .premium-sidebar.is-open { transform: translateX(0); }
    .topbar { padding-inline: 1rem; }
    .app-shell { padding: 1rem; }
}

@media (max-width: 767.98px) {
    .page-header-card .card-body,
    .hero-dashboard { padding: 1.15rem; }
    .module-text { min-height: auto; }
    .auth-premium { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .auth-panel { padding: 1rem; }
    .auth-panel-inner { padding: 1.15rem; border-radius: 1.25rem; }
    .topbar-title { font-size: 1rem; }
}
