/*
 * ঘণ্টিকা — থিম "ফিতা · দপ্তর" (Omar-এর বাছাই, ২৭ সেপ্টেম্বর ২০২৬; docs/redesign-themes.md)।
 * ময়ূরকণ্ঠী শিরোনাম-পট্টি, বাঁ দিকে তালিকার মেনু। মেনু ৮ অক্টোবর ২০২৬
 * থেকে বাঁ দিকে (Omar: "admin panel menu should be at left side, as list"; আগে উপরে রিবন)।
 *
 * কেবল অফিস-প্যানেলে (/admin) লোড হয় — AdminPanelProvider-এর HEAD_END hook।
 * Filament-এর নিজের CSS "@layer"-এর ভেতরে, তাই এখানকার সাধারণ নিয়মই জেতে; !important
 * কেবল সেখানে, যেখানে Filament/Alpine নিজে inline style বসায়।
 *
 * সব রঙ নিচের টোকেনে — হালকা :root-এ, গাঢ় .dark-এ। নতুন রঙ টোকেনের বাইরে নয়।
 * স্কুলের নিজের রঙ (--gh-school) কেবল লোগোর ঘরে (Ribbon::schoolColor)।
 */

:root {
    --gh-ground: #F2F5F4;
    --gh-surface: #FFFFFF;
    --gh-title: #0A4E55;
    --gh-ribbon: #E3EFEE;
    --gh-ink: #122A2E;
    --gh-ink-soft: #46605F;
    --gh-line: #CFDDDB;
    --gh-brass: #946419;
    --gh-brass-light: #D9A441;
    --gh-on-title: #FFFFFF;
    --gh-btn-icon: #0E6770;
    --gh-btn-hover: #D3E6E4;
    --gh-field: rgba(255, 255, 255, 0.14);
    --gh-field-line: rgba(255, 255, 255, 0.28);
}

.dark {
    --gh-ground: #0E1B1D;
    --gh-surface: #13272A;
    --gh-title: #06363B;
    --gh-ribbon: #16353A;
    --gh-ink: #E3EFEE;
    --gh-ink-soft: #A7C4C1;
    --gh-line: #2A4D51;
    --gh-btn-icon: #7CC2BA;
    --gh-btn-hover: #1E4449;
}

/* ---------- ভিত্তি ---------- */

.fi-body {
    background: var(--gh-ground);
}

/* ---------- শিরোনামের পট্টি (Filament-এর topbar) ---------- */

.fi-topbar {
    min-height: 3.5rem;
    background: var(--gh-title);
    color: var(--gh-on-title);
    box-shadow: none;
    border: 0;
    gap: 0.75rem;
}

.fi-topbar .fi-topbar-start {
    /* Filament ফোনে লোগো লুকায়; ফোনেও নাম চাই — কোন পণ্যে, কোন স্কুলে আছি */
    display: flex;
}

.fi-topbar .fi-icon-btn,
.fi-topbar .fi-user-menu-trigger {
    color: var(--gh-on-title);
}

.fi-topbar .fi-input-wrp {
    background: var(--gh-field);
    box-shadow: inset 0 0 0 1px var(--gh-field-line);
}

.fi-topbar .fi-input-wrp input,
.fi-topbar .fi-input-wrp .fi-icon {
    color: var(--gh-on-title);
}

.fi-topbar .fi-input-wrp input::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

/* স্কুলের পরিচয় — লোগোর ঘর, নাম, শিক্ষাবর্ষ */
.gh-school {
    display: none;
    align-items: center;
    gap: 0.625rem;
    margin-inline-start: 0.75rem;
    padding-inline-start: 1rem;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--gh-on-title);
    min-width: 0;
}

@media (min-width: 768px) {
    .gh-school {
        display: flex;
    }
}

.gh-school-well {
    width: 2.125rem;
    height: 2.125rem;
    flex-shrink: 0;
    border-radius: 0.5625rem;
    background: var(--gh-school, var(--gh-brass));
    color: var(--gh-school-ink, #FFFFFF);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1rem;
    overflow: hidden;
}

.gh-school-well img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #FFFFFF;
}

.gh-school-name {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 18rem;
}

.gh-year {
    font-size: 0.8125rem;
    line-height: 1.4;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

/* ---------- মেনু: বাঁ দিকে তালিকা (Filament-এর নিজের sidebar) ---------- */
/*
 * ভাগ (দৈনন্দিন, মানুষ, একাডেমিক, স্কুল) শিরোনাম, তার নিচে পাতাগুলো — Filament-এর নিজের
 * তালিকা, তাই অনুমতি ও "কোন পাতায় আছি" চিহ্ন আগের মতোই। ফোনে ☰ বোতামে খোলে।
 * এখানে কেবল রঙ আর আঙুলে চাপার মাপ।
 */

.fi-sidebar {
    background: var(--gh-surface);
    border-inline-end: 1px solid var(--gh-line);
}

/* ফোনে তালিকার মাথায় লোগো — সাদা লোগো, তাই শিরোনাম-পট্টির রঙ */
.fi-sidebar-header {
    background: var(--gh-title);
}

.fi-sidebar-header .fi-icon-btn {
    color: var(--gh-on-title);
}

.fi-topbar-open-sidebar-btn,
.fi-topbar-close-sidebar-btn {
    color: var(--gh-on-title);
}

.fi-sidebar-group-label {
    color: var(--gh-ink-soft);
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* প্রতিটি পাতা আঙুলে চাপার মতো উঁচু (≥ ৪৪px) */
.fi-sidebar-item-btn {
    min-height: 2.75rem;
    border-radius: 0.625rem;
    color: var(--gh-ink);
}

.fi-sidebar-item-btn:hover {
    background: var(--gh-btn-hover);
}

.fi-sidebar-item-icon {
    color: var(--gh-btn-icon);
}

/* এখনকার পাতা — ময়ূরকণ্ঠীর হালকা পট আর বাঁ দিকে পিতলের দাগ */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--gh-ribbon);
    box-shadow: inset 3px 0 0 var(--gh-brass);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: var(--gh-title);
    font-weight: 700;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: var(--gh-ink);
}

/* ---------- ড্যাশবোর্ডের "শুরুর কাজ" (SetupChecklistWidget) ---------- */

.gh-setup-progress {
    margin: 0 0 0.5rem;
    color: var(--gh-ink-soft);
    font-weight: 600;
}

.gh-setup-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--gh-line);
    overflow: hidden;
    margin-bottom: 1rem;
}

.gh-setup-bar > span {
    display: block;
    height: 100%;
    background: var(--gh-brass);
}

.gh-setup-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* প্রতিটি ধাপ পুরোটাই চাপা যায় — আঙুলে চাপার মতো উঁচু */
.gh-setup-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 3.25rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gh-line);
    border-radius: 0.75rem;
    color: var(--gh-ink);
    text-decoration: none;
}

.gh-setup-link:hover {
    background: var(--gh-btn-hover);
}

.gh-setup-link:focus-visible {
    outline: 3px solid var(--gh-brass-light);
    outline-offset: 2px;
}

.gh-setup-mark {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--gh-ribbon);
    color: var(--gh-title);
    font-weight: 700;
}

.gh-setup-done .gh-setup-mark {
    background: #2E7D4F;
    color: #FFFFFF;
}

.gh-setup-check {
    width: 1.125rem;
    height: 1.125rem;
}

.gh-setup-text {
    display: grid;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.gh-setup-label {
    font-weight: 700;
}

.gh-setup-hint {
    color: var(--gh-ink-soft);
    font-size: 0.875rem;
}

.gh-setup-done .gh-setup-label {
    color: var(--gh-ink-soft);
}

.gh-setup-state {
    flex: none;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gh-brass);
}

.gh-setup-done .gh-setup-state {
    color: #2E7D4F;
}

.dark .gh-setup-done .gh-setup-state {
    color: #7CC2BA;
}

/* ---------- ভূমিকা ও প্রবেশাধিকারের ছক (RoleGrid) ---------- */

.gh-grid-card {
    background: var(--gh-surface);
    border: 1px solid var(--gh-line);
    border-radius: 0.75rem;
    overflow: hidden;
}

.gh-grid-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gh-line);
}

.gh-grid-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--gh-ink-soft);
    font-size: 0.875rem;
}

.gh-grid-legend .gh-cell {
    min-width: 0;
    height: 1.75rem;
    padding: 0 0.625rem;
    cursor: default;
}

.gh-grid-hint {
    flex-basis: 100%;
    margin: 0.25rem 0 0;
}

.gh-grid-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.gh-grid-status {
    color: var(--gh-ink-soft);
    font-size: 0.875rem;
    font-weight: 600;
}

.gh-grid-status-dirty {
    color: var(--gh-brass);
}

/* ফোনে ছকটি পাশে সরে; পাতার নামের কলাম বাঁয়ে আটকে থাকে */
.gh-grid-scroll {
    overflow-x: auto;
}

.gh-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--gh-ink);
}

.gh-grid th,
.gh-grid td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--gh-line);
    text-align: center;
    vertical-align: middle;
}

.gh-grid tbody tr:last-child > * {
    border-bottom: 0;
}

.gh-grid .gh-grid-corner,
.gh-grid .gh-grid-area {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 11rem;
    background: var(--gh-surface);
    text-align: left;
    font-weight: 600;
}

.gh-grid .gh-grid-corner {
    color: var(--gh-ink-soft);
    font-size: 0.875rem;
}

.gh-grid .gh-grid-role {
    min-width: 6.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.gh-grid-role-name {
    display: block;
    font-weight: 700;
    line-height: 1.3;
    color: var(--gh-ink);
    text-decoration: none;
}

a.gh-grid-role-name {
    color: var(--gh-btn-icon);
}

a.gh-grid-role-name:hover {
    text-decoration: underline;
}

.gh-grid-users {
    display: block;
    margin-top: 0.125rem;
    color: var(--gh-ink-soft);
    font-size: 0.8125rem;
    font-weight: 400;
}

.gh-grid-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    color: var(--gh-brass);
    font-size: 0.75rem;
    font-weight: 600;
}

.dark .gh-grid-lock {
    color: var(--gh-brass-light);
}

.gh-grid-lock-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.gh-grid .gh-grid-group > th {
    background: var(--gh-ground);
    color: var(--gh-brass);
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: left;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* সারিটি পুরো চওড়া — তাই নামটি নিজে বাঁয়ে আটকে থাকে, ছক পাশে সরলেও দেখা যায় */
.gh-grid-group-label {
    position: sticky;
    left: 0.5rem;
}

.dark .gh-grid .gh-grid-group > th {
    color: var(--gh-brass-light);
}

/* একটি ঘর — আঙুলে চাপার মতো বড় */
.gh-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 5.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.1s;
}

.gh-cell:not(:disabled):hover {
    filter: brightness(0.94);
}

.gh-cell:focus-visible {
    outline: 3px solid var(--gh-brass-light);
    outline-offset: 2px;
}

.gh-cell:disabled {
    cursor: default;
}

/* তালা দেওয়া কলাম — হালকা; চাপার অপেক্ষার মুহূর্তে বাকি ঘর ঝাপসা হয় না */
.gh-cell-locked {
    opacity: 0.6;
}

.gh-cell-none {
    border: 1px dashed var(--gh-line);
    color: var(--gh-ink-soft);
}

.gh-cell-view {
    background: var(--gh-ribbon);
    border-color: var(--gh-btn-icon);
    color: var(--gh-title);
}

.gh-cell-change {
    background: var(--gh-title);
    border-color: var(--gh-title);
    color: #FFFFFF;
}

.dark .gh-cell-view {
    color: var(--gh-btn-icon);
}

.dark .gh-cell-change {
    background: var(--gh-btn-icon);
    border-color: var(--gh-btn-icon);
    color: #06363B;
}

/* সব শ্রেণির শাখার ছক (SectionGridPage) — কলামের মাথায় ছোট বোতাম */
.gh-grid-col-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.125rem 0.5rem;
    margin-top: 0.375rem;
}

.gh-grid-link {
    color: var(--gh-btn-icon);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: 0;
    padding: 0.125rem;
    cursor: pointer;
}

.gh-grid-empty {
    margin: 0;
    padding: 1.5rem 1rem;
    color: var(--gh-ink-soft);
}

/* ফোনে পাতার নামের কলাম সরু — ভূমিকার জন্য জায়গা বেশি */
@media (max-width: 640px) {
    .gh-grid .gh-grid-corner,
    .gh-grid .gh-grid-area {
        min-width: 7.5rem;
        max-width: 7.5rem;
        white-space: normal;
        font-size: 0.875rem;
    }

    .gh-grid .gh-grid-role {
        min-width: 5.5rem;
    }

    .gh-cell {
        min-width: 4.75rem;
    }
}

/* বদলেছে, জমা হয়নি — পিতলের রিং আর কোণে বিন্দু */
.gh-cell-dirty {
    box-shadow: 0 0 0 2px var(--gh-brass-light);
}

.gh-cell-dirty::after {
    content: "";
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--gh-brass);
}

/* ---------- লগইনের মতো একা পাতা: ময়ূরকণ্ঠী পট, মাঝে সাদা কার্ড ---------- */

.fi-simple-layout {
    background: var(--gh-title);
}

.fi-simple-main {
    background: var(--gh-surface);
    border-radius: 1rem;
}

/* লোগো: শিরোনাম-পট্টিতে সাদা সংস্করণ, লগইনের সাদা কার্ডে গাঢ় (resources/views/brand/logo.blade.php) */
.gh-logo-on-light {
    display: none !important;
}

.fi-simple-layout .gh-logo-on-dark {
    display: none !important;
}

.fi-simple-layout .gh-logo-on-light {
    display: inline-flex !important;
}

.dark .fi-simple-layout .gh-logo-on-dark {
    display: inline-flex !important;
}

.dark .fi-simple-layout .gh-logo-on-light {
    display: none !important;
}
