/**
 * 369B App — internal shell (dashboard, modules, POS non-lockscreen)
 * Fixes: (1) theme classes that lived only in resources/plugins/custom.css and were never linked,
 * (2) .ingzny-bg only applied at xl in tailwind build,
 * (3) PHP-generated Tailwind arbitrary colors (e.g. tw-bg-[#0f0f0f]) not present in compiled CSS.
 */
:root {
    --app-brand-gold: #ffc805;
    --app-brand-gold-dim: #e6b400;
    --app-brand-black: #0f0f0f;
}

/* Content area — match landing hero warmth on all breakpoints */
.ingzny-bg {
    background-color: #fafafa;
    background-image:
        radial-gradient(1200px 600px at 50% -20%, rgba(255, 200, 5, 0.12), transparent 55%),
        radial-gradient(800px 400px at 100% 100%, rgba(15, 15, 15, 0.04), transparent 50%),
        radial-gradient(640px 480px at 0% 100%, rgba(255, 200, 5, 0.06), transparent 50%),
        linear-gradient(165deg, #ffffff 0%, #f4f4f5 45%, #fff9e6 100%);
    background-attachment: local;
}

/* Top bar — brand strip (header uses tw-bg-gradient-to-r + primary border) */
main.tw-flex.tw-flex-col > .no-print.tw-border-b:first-child {
    background-image: linear-gradient(90deg, #0f0f0f 0%, #1a1a1a 100%) !important;
    border-bottom-color: rgba(255, 200, 5, 0.22) !important;
}

/* ——— Sidebar shell (class side-bar on aside) ——— */
.side-bar {
    background-color: #fff !important;
    border-right: 1px solid #e5e7eb;
}
.side-bar .side-bar-heading {
    color: var(--app-brand-black) !important;
}

/* Sidebar header — same logos + structure as auth login (light surface) */
.side-bar-brand-header {
    box-sizing: border-box;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.side-bar-brand-medical {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(15, 15, 15, 0.08));
}

.side-bar-brand-app-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.45rem 1rem;
    flex-wrap: wrap;
    border-radius: 9999px;
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    border: 1px solid rgba(15, 15, 15, 0.08);
    max-width: 100%;
}

.side-bar-brand-369 {
    height: 1.75rem;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.side-bar-brand-app-name {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--app-brand-black);
    line-height: 1.2;
}

.side-bar-brand-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
    width: 100%;
    padding: 0 0.25rem;
}

.side-bar-brand-online {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: #22c55e;
    flex-shrink: 0;
}

.side-bar-brand-business {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.side-bar-brand-tagline {
    margin: 0.5rem 0 0;
    padding: 0 0.25rem;
    max-width: 14rem;
    font-size: 0.65rem;
    line-height: 1.4;
    font-weight: 500;
    color: rgba(15, 15, 15, 0.5);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Menu presenter uses tw-bg-[#0f0f0f] etc. — often missing from compiled Tailwind */
#side-bar a:hover,
#side-bar a:focus {
    background-color: var(--app-brand-black) !important;
    color: var(--app-brand-gold) !important;
}

#side-bar a.sidebar-item-active,
.side-bar .shortcuts-sidebar-section a.sidebar-item-active {
    background-color: var(--app-brand-black) !important;
    color: var(--app-brand-gold) !important;
}

#side-bar a:hover i,
#side-bar a.sidebar-item-active i {
    color: var(--app-brand-gold) !important;
}

/* Child menu column (nested items) */
.chiled a:hover,
.chiled a:focus,
.chiled a.sidebar-item-active {
    background-color: var(--app-brand-black) !important;
    color: var(--app-brand-gold) !important;
}

/* ——— Named theme helpers (header buttons, shortcuts, cards) ——— */
.theme-surface {
    background-color: var(--app-brand-black) !important;
    color: #ffffff;
}

.theme-surface--hover:hover,
.theme-surface--hover:focus {
    background-color: #262626 !important;
}

.theme-accent-text {
    color: var(--app-brand-gold) !important;
}

.theme-accent-text--hover:hover,
.theme-accent-text--hover:focus {
    color: var(--app-brand-gold) !important;
}

.theme-text-dark {
    color: var(--app-brand-black) !important;
}

.theme-btn {
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
}

.theme-btn--primary {
    background-color: var(--app-brand-black) !important;
    color: var(--app-brand-gold) !important;
    border: 1px solid rgba(255, 200, 5, 0.25);
}

.theme-btn--primary:hover,
.theme-btn--primary:focus {
    background-color: #262626 !important;
    color: var(--app-brand-gold) !important;
}

.theme-gradient {
    background-image: linear-gradient(90deg, #0f0f0f, #1a1a1a) !important;
}

.theme-gradient--text {
    background-image: linear-gradient(90deg, #0f0f0f, var(--app-brand-gold)) !important;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

/* Primary action buttons often use AdminLTE .btn-primary — align with brand */
.skin-blue-light .btn-primary,
.skin-blue .btn-primary,
.skin-green-light .btn-primary,
.skin-green .btn-primary,
.skin-purple-light .btn-primary,
.skin-purple .btn-primary,
.skin-red-light .btn-primary,
.skin-red .btn-primary,
.skin-yellow-light .btn-primary,
.skin-yellow .btn-primary,
.skin-black-light .btn-primary,
.skin-black .btn-primary {
    background-color: var(--app-brand-black) !important;
    border-color: rgba(255, 200, 5, 0.35) !important;
    color: var(--app-brand-gold) !important;
}

.skin-blue-light .btn-primary:hover,
.skin-blue .btn-primary:hover,
.skin-green-light .btn-primary:hover,
.skin-green .btn-primary:hover,
.skin-purple-light .btn-primary:hover,
.skin-purple .btn-primary:hover,
.skin-red-light .btn-primary:hover,
.skin-red .btn-primary:hover,
.skin-yellow-light .btn-primary:hover,
.skin-yellow .btn-primary:hover,
.skin-black-light .btn-primary:hover,
.skin-black .btn-primary:hover {
    background-color: #262626 !important;
    border-color: rgba(255, 200, 5, 0.45) !important;
    color: var(--app-brand-gold) !important;
}

/* ——— Home dashboard: dark hero strip vs light charts/widgets ——— */
.home-dashboard {
    color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 200, 5, 0.12);
    background: linear-gradient(165deg, #0f0f0f 0%, #141414 40%, #0f0f0f 100%);
}

.home-dashboard-welcome {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Copy on dark strip: AdminLTE boxes stay light surfaces with dark text */
.home-dashboard .box {
    color: #1f2937;
    background-color: #ffffff;
}

/* Tailwind white cards on dark hero — default body text dark (avoid inheriting white from .home-dashboard) */
.home-dashboard .tw-bg-white {
    color: #111827;
}

.home-dashboard .box-header,
.home-dashboard .box-title,
.home-dashboard .box-header .box-title {
    color: #111827 !important;
}

.home-dashboard .box-header.with-border {
    border-bottom-color: rgba(15, 15, 15, 0.08);
}

.home-dashboard .box-body,
.home-dashboard .box-body label,
.home-dashboard .table {
    color: #374151;
}

.home-dashboard .table thead th {
    color: #111827;
}

.home-dashboard caption {
    color: #6b7280 !important;
}

/* Light section below hero (charts, tables) — always dark text on warm page bg */
.home-dashboard-body {
    color: #111827;
}

.home-dashboard-body h3.tw-font-bold,
.home-dashboard-body .tw-font-bold.tw-text-base,
.home-dashboard-body .tw-font-bold.tw-text-xl {
    color: #0f0f0f;
}

.home-dashboard-body .tw-text-gray-500 {
    color: #6b7280 !important;
}

.home-dashboard-body .tw-text-gray-900,
.home-dashboard-body .tw-text-gray-800 {
    color: #111827 !important;
}

.home-dashboard-body tr.bg-gray,
.home-dashboard-body .footer-total {
    color: #111827 !important;
    background-color: #f3f4f6 !important;
}

.home-dashboard-body .table-bordered th,
.home-dashboard-body .table-bordered td {
    color: #374151;
}

/* ——— RTL: box-header — title at one end, .box-tools at the other (like LTR) ——— */
[dir='rtl'] .box-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

[dir='rtl'] .box-header .box-tools {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    float: none !important;
    margin-inline-start: auto;
}

[dir='rtl'] .box-header .box-title {
    margin-top: 0;
    margin-bottom: 0;
    flex: 0 1 auto;
    min-width: 0;
}

[dir='rtl'] .box-header > .pull-right {
    float: none !important;
    margin-inline-start: auto;
}

/* Direct child buttons/links (no .box-tools wrapper) — align to end */
[dir='rtl'] .box-header > a.btn,
[dir='rtl'] .box-header > .btn-group {
    margin-inline-start: auto;
}
