/*
 * HERA Global Visual Theme Foundation V1
 * Approved visual direction from My HERA Quick Actions V5.
 * Scope: visual treatment only; no structural/layout changes.
 */
:root {
    --hera-gold: #F09B1E;
    --hera-gold-deep: #C87808;
    --hera-gold-soft: #FFF4DF;
    --hera-gold-border: #EED9B2;
    --hera-graphite: #17191C;
    --hera-graphite-2: #20262B;
    --hera-graphite-warm: #4A3211;
    --hera-ink: #1F2937;
    --hera-muted: #667085;
    --hera-line: #E7E1D6;
    --hera-surface: #FFFFFF;
    --hera-surface-warm: #FFFCF7;
    --hera-page: #F7F8F9;
    --hera-shadow-sm: 0 6px 18px rgba(15,23,42,.055);
    --hera-shadow-md: 0 12px 30px rgba(15,23,42,.09);
    --hera-radius-sm: 10px;
    --hera-radius-md: 14px;
    --hera-radius-lg: 18px;
}

/* Page foundation */
html, body {
    background: var(--hera-page);
    color: var(--hera-ink);
}

/* Generic panels/cards — deliberately excludes sidebar/topbar/navigation wrappers. */
main .card,
main .panel,
main .box,
main .widget,
main .content-card,
main .stat-card,
main .metric-card,
main article.card,
main section.card,
.app-content .card,
.page-content .card,
.content-wrapper .card {
    border-color: var(--hera-line);
    background: var(--hera-surface);
    box-shadow: var(--hera-shadow-sm);
}

/* Form controls */
main input:not([type="checkbox"]):not([type="radio"]),
main select,
main textarea,
.app-content input:not([type="checkbox"]):not([type="radio"]),
.app-content select,
.app-content textarea,
.page-content input:not([type="checkbox"]):not([type="radio"]),
.page-content select,
.page-content textarea {
    border-color: #D9DDE3;
    background: #FFF;
    color: var(--hera-ink);
}

main input:focus,
main select:focus,
main textarea:focus,
.app-content input:focus,
.app-content select:focus,
.app-content textarea:focus,
.page-content input:focus,
.page-content select:focus,
.page-content textarea:focus {
    border-color: var(--hera-gold);
    box-shadow: 0 0 0 3px rgba(240,155,30,.13);
    outline: none;
}

/* Safe primary-action treatment. Avoid destructive/status buttons. */
main .btn-primary:not(.btn-danger):not(.danger):not(.destructive),
main button.primary:not(.danger):not(.destructive),
main a.primary-action,
.app-content .btn-primary:not(.btn-danger):not(.danger):not(.destructive),
.page-content .btn-primary:not(.btn-danger):not(.danger):not(.destructive) {
    background: linear-gradient(135deg, var(--hera-graphite) 0%, var(--hera-graphite-2) 68%, var(--hera-graphite-warm) 100%);
    border-color: rgba(240,155,30,.34);
    color: #FFF;
    box-shadow: 0 9px 22px rgba(15,23,42,.11);
}

main .btn-primary:not(.btn-danger):not(.danger):not(.destructive):hover,
main button.primary:not(.danger):not(.destructive):hover,
main a.primary-action:hover,
.app-content .btn-primary:not(.btn-danger):not(.danger):not(.destructive):hover,
.page-content .btn-primary:not(.btn-danger):not(.danger):not(.destructive):hover {
    border-color: rgba(240,155,30,.60);
    box-shadow: 0 13px 28px rgba(15,23,42,.15);
    filter: brightness(1.035);
}

/* Gold-accent buttons remain gold. */
main .btn-warning,
main .btn-gold,
main .hera-gold-action,
.app-content .btn-warning,
.app-content .btn-gold,
.page-content .btn-warning,
.page-content .btn-gold {
    background: var(--hera-gold);
    border-color: var(--hera-gold);
    color: #17191C;
}

/* Secondary controls */
main .btn-secondary,
main .btn-outline-secondary,
.app-content .btn-secondary,
.app-content .btn-outline-secondary,
.page-content .btn-secondary,
.page-content .btn-outline-secondary {
    background: var(--hera-surface-warm);
    border-color: var(--hera-gold-border);
    color: var(--hera-ink);
}

/* Tables */
main table,
.app-content table,
.page-content table {
    background: #FFF;
}

main table thead th,
.app-content table thead th,
.page-content table thead th {
    background: #FBF8F2;
    color: #3B4149;
    border-color: #EAE3D7;
}

main table tbody tr:hover,
.app-content table tbody tr:hover,
.page-content table tbody tr:hover {
    background: #FFFBF4;
}

/* Tabs/pills/badges */
main .nav-tabs .nav-link.active,
main .tab.active,
main .pill.active,
.app-content .nav-tabs .nav-link.active,
.page-content .nav-tabs .nav-link.active {
    border-color: var(--hera-gold);
    color: #8A5200;
}

main .badge-gold,
main .badge-warning,
.app-content .badge-gold,
.page-content .badge-gold {
    background: var(--hera-gold-soft);
    color: #8A5200;
    border-color: #F3D39B;
}

/* Links in application content */
main a:not(.btn):not([class*="nav"]):not([class*="sidebar"]),
.app-content a:not(.btn):not([class*="nav"]):not([class*="sidebar"]),
.page-content a:not(.btn):not([class*="nav"]):not([class*="sidebar"]) {
    text-decoration-color: rgba(240,155,30,.35);
}

/* Global utility classes for future pages. */
.hera-surface-warm { background: var(--hera-surface-warm) !important; }
.hera-border-gold { border-color: var(--hera-gold-border) !important; }
.hera-text-gold { color: var(--hera-gold-deep) !important; }
.hera-bg-gold-soft { background: var(--hera-gold-soft) !important; }
.hera-premium-dark {
    background: linear-gradient(135deg, var(--hera-graphite) 0%, var(--hera-graphite-2) 68%, var(--hera-graphite-warm) 100%) !important;
    border-color: rgba(240,155,30,.34) !important;
    color: #FFF !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
