/* Admin layout (matches provided screenshot) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background-color: #f5f5f5 !important;
}

/* Layout Container */
.custom-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.custom-sidebar {
    width: 228px;
    background-color: #c8a652;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.custom-sidebar::-webkit-scrollbar {
    display: none;
}

/* Logo Section */
.sidebar-logo {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-img {
    width: 190px !important;
    height: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #000;
    opacity: 0.8;
}

/* Navigation Items */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item-group {
    margin: 0.25rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    color: #000;
    text-decoration: none;
    border-radius: 9999px;
    position: relative;
    transition: all 0.2s;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    background: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: calc(100% - 1rem);
    text-align: left;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    background-color: #f5f5f5;
    font-weight: 600;
    padding-right: 0;
    margin-right: 0;
    border-radius: 9999px 0 0 9999px;
    width: 100%;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    right: 0;
    top: -24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border-bottom-right-radius: 14px;
    box-shadow: 12px 12px 0 12px #f5f5f5;
}

.nav-item.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border-top-right-radius: 14px;
    box-shadow: 12px -12px 0 12px #f5f5f5;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Submenu Toggle Arrow */
.nav-item-toggle {
    justify-content: space-between;
}

/* ACTIVE STATE FOR SUBMENU PARENT WITH CURVES */
.nav-item-toggle.active {
    background-color: #f5f5f5 !important;
    font-weight: 600;
    padding-right: 0;
    margin-right: 0;
    border-radius: 9999px 0 0 9999px !important;
    width: 100%;
    position: relative;
}

/* Top curve for submenu parent */
.nav-item-toggle.active::before {
    content: "";
    position: absolute;
    right: 0;
    top: -24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border-bottom-right-radius: 10px;
    box-shadow: 12px 12px 0 12px #f5f5f5;
    pointer-events: none;
}

/* Bottom curve for submenu parent - ONLY when submenu is closed */
.nav-item-toggle.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border-top-right-radius: 10px;
    box-shadow: 12px -12px 0 12px #f5f5f5;
    pointer-events: none;
}

/* Remove bottom curve when submenu is expanded */
.nav-item-toggle.active:has(+ .nav-submenu.show)::after {
    display: none;
}

.nav-item-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-item-arrow.rotate {
    transform: rotate(180deg);
}

/* Submenu Styles */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
    margin-right: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 0 0 20px 0;
    position: relative;
}

.nav-submenu.show {
    max-height: 500px;
}

/* Add bottom curve to expanded submenu */
.nav-submenu.show::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border-top-right-radius: 10px;
    box-shadow: 12px -12px 0 12px #f5f5f5;
    pointer-events: none;
}

.sidebar-bookings-link.is-active {
    background: #c8a652 !important;
    font-weight: 700 !important;
    color: #000 !important;
    border-radius: 9999px !important;
    padding: 0.75rem 1.5rem !important;
}

.sidebar-bookings-link:hover {
    border-radius: 9999px !important;
    padding: 0.75rem 1.5rem !important;
}

/* Main Content Area */
.custom-main {
    margin-left: 228px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
}

/* Top Header */
.custom-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 1rem 2rem;
    margin-left: 30px;
    margin-right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: "Raleway", sans-serif;
    color: #000;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    background-color: transparent;
    border: none;
}

.header-icon-btn:hover {
    background-color: rgba(200, 166, 82, 0.12);
}

.admin-header-icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* Keep Filament's database notifications dropdown aligned in our header */
.fi-dropdown-panel {
    border-radius: 12px;
}

/* Page Content */
.custom-content {
    flex: 1;
    padding: 2rem;
    background-color: #f5f5f5;
}

/* Card Container 
.content-card {
    background-color: #f5f5f5 !important;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}*/

/* ====== TABLE SEARCH + FILTER BAR ====== */
.fi-ta-header-ctn {
    border: none !important;
    background: transparent !important;
}

.fi-ta-header-toolbar {
    padding: 1rem 1.5rem !important;
    background-color: transparent !important;
}

/* Search field: allow it to grow (flex handled in admin-custom.css) */
.fi-ta-header-toolbar .fi-ta-search-field {
    position: relative;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    /* Removed min-width: 360px — was preventing full-width layout */
}

.fi-ta-header-toolbar .fi-input-wrp {
    border-radius: 9999px !important;
    background-color: #f5f5f5 !important;
    border: none !important;
    box-shadow: none !important;
}

.fi-ta-header-toolbar .fi-input-wrp-input .fi-input {
    background: transparent !important;
    border-radius: 9999px !important;
    padding-left: 0.5rem !important;
    padding-right: 3rem !important;
    font-size: 0.9rem !important;
}

.fi-ta-header-toolbar .fi-input-wrp-icon {
    color: #9ca3af !important;
}

.fi-ta-header-toolbar .fi-input-wrp-prefix {
    display: none !important;
}

.fi-ta-header-toolbar .fi-ta-filters-trigger,
.fi-ta-header-toolbar .fi-ta-header-actions .fi-btn {
    border-radius: 8px !important;
    background-color: #c8a652 !important;
    color: #000 !important;
    border: none !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
}

.fi-ta-header-toolbar .fi-ta-filters-trigger {
    background-color: #f5f5f5 !important;
    color: #9ca3af !important;
    border-radius: 9999px !important;
    padding-inline: 1.25rem !important;
}

/* ====== DASHBOARD WIDGET LAYOUT ====== */
.fi-dashboard-page .fi-page-content > div {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    position: relative !important;
}

.fi-dashboard-page .fi-widget-recent-activity {
    grid-column: 10 / span 3;
    grid-row: 1 / -1;
    position: sticky;
    top: 2rem;
    align-self: start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* ====== USER DETAILS TABLE CARD ====== */
.content-card .fi-ta-ctn {
    background-color: #fff !important;
    border-radius: 12px !important;
    overflow: visible; /* Changed from hidden to prevent clipping dropdowns */
    box-shadow: none !important;
}

.content-card .fi-ta-header-ctn {
    background-color: #c8a652 !important;
    padding: 0 !important;
}

.content-card .fi-ta-header-cell {
    background-color: #c8a652 !important;
    color: #000 !important;
    font-weight: 600 !important;
    padding: 1rem !important;
    font-size: 0.95rem !important;
}

.content-card .fi-ta-header {
    width: 100% !important;
    background-color: #c8a652 !important;
}

.content-card .fi-ta-row {
    background-color: #fff !important;
}

.content-card .fi-ta-cell {
    color: #000 !important;
    padding: 0.75rem 1rem !important;
}

/* ====== DASHBOARD FLEX LAYOUT (FIGMA-LIKE) ====== */
.dashboard-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 0 0 1150px;
}

.dashboard-row-two {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.dashboard-row-two-item {
    flex: 1 1 0;
}

.dashboard-activity {
    flex: 0 0 370px;
}

.dashboard-activity > .fi-widget {
    height: 960px;
}

.dashboard-activity .fi-section {
    height: 100%;
}

/* ===== Payments Header Cards ===== */
.fi-wi-stats-overview {
    margin-bottom: 1.5rem;
}

.fi-wi-stats-overview-stat {
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.fi-wi-stats-overview-stat-value {
    color: #c8a652 !important;
    font-weight: 700;
    font-size: 1.6rem;
}

.fi-wi-stats-overview-stat-label {
    font-weight: 600;
    color: #000;
}

.beige-section > .fi-section-header {
    background-color: #f5e6c8;
    margin-top: -60px !important;
}

.beige-section .fi-section-header-heading {
    color: #6b4e16;
    font-weight: 600;
    margin-top: -60px !important;
}

/* REMOVE empty Filament page header block */
.fi-page-header {
    display: none !important;
}

.fi-page-header + .fi-page-content {
    padding-top: 0 !important;
}

/* Remove EMPTY Filament section blocks */
.fi-section:has(.fi-section-content:empty) {
    display: none !important;
}

.fi-section-content:empty {
    padding: 0 !important;
    margin: 0 !important;
}

/* Beige outer background (sidebar section) */
.sidebar-service-card,
.sidebar-bookings-card {
    position: relative;
    background: #f5f5f5;
    border-radius: 20px 0 0 20px;
    padding: 12px 5px 6px 5px;

    /* Prevent scrollbar */
}

/* White inner card */
.sidebar-service-card .active {
    position: relative;
    background: #f5f5f5;
    margin: 20px 0 !important;
    margin: 0 12px;
    border-radius: 20px 0 0 20px;
    padding: 20px 0;
}

/* Top curve cutout */
.sidebar-service-link.active::before {
    content: "";
    position: absolute;
    top: -20px;
    right: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(
        circle at top right,
        transparent 20px,
        #f5f5f5 20px
    );
}

/* Bottom curve cutout */
.sidebar-service-link.active::after {
    content: "";
    position: absolute;
    bottom: -20px;
    right: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(
        circle at bottom right,
        transparent 20px,
        #f5f5f5 20px
    );
}

/* Submenu links */
.sidebar-service-link {
    display: block !important;
    text-align: center;
    width: fit-content !important;
    margin: 0 auto 5px auto !important;
    padding: 8px 12px;
    text-decoration: none;
}

/* Active pill */
.sidebar-service-link.is-active,
.sidebar-service-pill.is-active,
.sidebar-bookings-link.is-active,
.sidebar-bookings-pill.is-active {
    display: block !important;
    width: fit-content !important;
    margin: 0 auto 5px auto !important;
    text-align: center !important;
    padding: 8px 24px !important;
    background: #c8a652 !important;
    color: #000 !important;
    font-weight: 700;
    border-radius: 999px;
}

/* Ensure pill also has reduced spacing */
.sidebar-service-pill,
.sidebar-bookings-pill {
    display: block !important;
    text-align: center;
    width: fit-content !important;
    margin: 0 auto 5px auto !important;
    padding: 8px 12px;
    text-decoration: none;
}

.sidebar-service-link:hover,
.sidebar-service-pill:hover,
.sidebar-bookings-link:hover,
.sidebar-bookings-pill:hover {
    background-color: rgba(200, 166, 82, 0.12);
    border-radius: 999px;
}

.sidebar-service-link.is-active:hover,
.sidebar-service-pill.is-active:hover,
.sidebar-bookings-link.is-active:hover,
.sidebar-bookings-pill.is-active:hover {
    background: #c8a652 !important;
}

/* ───────────────────────────────────────────────────────────
   HAMBURGER BUTTON - always in the DOM, hidden on desktop
─────────────────────────────────────────────────────────── */
.admin-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 14px;
    flex-shrink: 0;
}

.admin-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #1a1a1a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ───────────────────────────────────────────────────────────
   SIDEBAR CLOSE BUTTON - hidden on desktop
─────────────────────────────────────────────────────────── */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #000;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    font-weight: 300;
}

/* ───────────────────────────────────────────────────────────
   OVERLAY MASK - hidden by default
─────────────────────────────────────────────────────────── */
.admin-sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
}

.admin-sidebar-mask.active {
    display: block;
}

/* ───────────────────────────────────────────────────────────
   TABLES — dropdown-safe overflow
   
   The fundamental CSS problem: overflow-x:auto forces overflow-y:auto
   too (browser spec), which creates a scroll context that clips
   absolutely-positioned dropdown panels on the last table row.

   Desktop fix: both wrappers use overflow:visible — no scroll context,
   dropdowns render freely. The 700px table always fits inside the
   ~1100px+ content area on desktop, so no horizontal scroll is needed.

   Mobile fix: overflow-x:auto is added inside @media (max-width:1024px)
   so tables still scroll horizontally on small screens.
─────────────────────────────────────────────────────────── */
.fi-ta-ctn {
    overflow: visible !important;
}

/* Override Filament's own overflow-x-auto Tailwind class on .fi-ta-content */
.fi-ta-content {
    overflow: visible !important;
}

.fi-ta-content,
.fi-ta-table {
    min-width: 700px !important;
}

/* ───────────────────────────────────────────────────────────
   MOBILE / TABLET  ≤ 1024px
─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Show the three-line hamburger */
    .admin-hamburger {
        display: flex !important;
    }

    /* Show the × close button inside sidebar */
    .sidebar-close-btn {
        display: block !important;
    }

    /* SIDEBAR: slide off to the left, animate in when .sidebar-open */
    .custom-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 270px !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
    }

    /* Open state - slide in */
    .custom-sidebar.sidebar-open {
        transform: translateX(0) !important;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.2) !important;
    }

    /* Main content takes full width - no sidebar indent */
    .custom-main {
        margin-left: 0 !important;
    }

    /* Header: hamburger + title + icons, all on one row, sticky */
    .custom-header {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        padding: 0.85rem 1rem !important;
        margin: 0 0 10px 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 10px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
    }

    .header-title {
        flex: 1 !important;
        font-size: 1rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 0 !important;
    }

    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0;
    }

    .header-icon-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .admin-header-icon {
        width: 18px !important;
        height: 18px !important;
    }

    /* Tighter page content on mobile */
    .custom-content {
        padding: 0.75rem !important;
    }

    /* Tighter table container — restore horizontal scroll on small screens
       (the dropdown clipping issue doesn't matter as much on mobile since
       users scroll the whole page, and dropdowns flip to fit on screen) */
    .fi-ta-ctn {
        padding: 0 6px 14px 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Custom HTML tables (.table-wrapper) also need horizontal scroll on mobile */
    .table-wrapper,
    .sm-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ───────────────────────────────────────────────────────────
   FORM GRID: single column on small screens
─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .fi-fo-grid,
    .fi-fo-component-ctn.grid {
        grid-template-columns: 1fr !important;
    }

    .fi-form-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .fi-form-actions .fi-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* -----------------------------------------------------------
   FILAMENT TABLE ACTIONS � force beige/gold icon color
   Covers: ViewAction, EditAction, DeleteAction, ActionGroup
----------------------------------------------------------- */

/* Individual action icon buttons (View / Edit / Delete shown inline) */
.fi-ta-actions .fi-icon-btn svg,
.fi-ta-actions .fi-ac-icon-btn svg,
.fi-ta-row-actions .fi-icon-btn svg,
.fi-ta-row-actions .fi-ac-icon-btn svg,
.fi-ta-col-action .fi-icon-btn svg,
.fi-table-actions .fi-icon-btn svg {
    color: #c8a652 !important;
    stroke: #c8a652 !important;
}

/* Action group trigger (three-dot menu button) */
.fi-ta-actions .fi-dropdown-trigger svg,
.fi-ta-row-actions .fi-dropdown-trigger svg {
    color: #c8a652 !important;
    stroke: #c8a652 !important;
}

/* Generic catch-all: any icon button inside a table row */
table .fi-icon-btn svg,
table .fi-ac-icon-btn svg,
.fi-ta-row .fi-icon-btn svg,
.fi-ta-row .fi-ac-icon-btn svg {
    color: #c8a652 !important;
    stroke: #c8a652 !important;
}

/* Force ALL table SVGs to be beige regardless of specific Filament class */
.fi-ta-actions svg,
.fi-ta-row-actions svg,
.fi-ac-action svg,
table td svg {
    color: #000 !important;
    stroke: #000000 !important;
}
