/* ═══════════════════════════════════════════════════════════
   GRAINMARKET ADMIN — CUSTOM UI OVERRIDES
   Loaded after app.min.css so all rules here take priority
═══════════════════════════════════════════════════════════ */

/* ─── Sidebar shell ─────────────────────────────────────── */
.vertical-menu {
    background: linear-gradient(180deg, #1c2035 0%, #222845 100%) !important;
    border-right: none !important;
}

/* ─── Logo / brand box ──────────────────────────────────── */
.navbar-brand-box {
    background: linear-gradient(135deg, #556ee6 0%, #4254c7 100%) !important;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

/* ─── Sidebar scroll area ───────────────────────────────── */
[data-simplebar] { padding-top: 4px; }

/* ─── Sidebar search box ────────────────────────────────── */
.sidebar-search {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 7px 12px;
    transition: border-color 0.18s, background 0.18s;
}

.sidebar-search-inner:focus-within {
    background: rgba(255,255,255,0.11);
    border-color: rgba(85,110,230,0.7);
}

.sidebar-search-icon {
    color: rgba(255,255,255,0.35);
    font-size: 1rem;
    flex-shrink: 0;
    transition: color 0.18s;
}

.sidebar-search-inner:focus-within .sidebar-search-icon {
    color: #7eb8f7;
}

.sidebar-search-inner input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.82rem;
    width: 100%;
}

.sidebar-search-inner input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Hide menu items that don't match search */
#sidebar-menu li.search-hidden {
    display: none !important;
}

/* ─── Section labels ────────────────────────────────────── */
#sidebar-menu .menu-title {
    color: rgba(255,255,255,0.28) !important;
    font-size: 0.6rem !important;
    letter-spacing: 2px !important;
    font-weight: 700 !important;
    padding: 20px 22px 7px !important;
    text-transform: uppercase;
}

/* ─── Top-level items ───────────────────────────────────── */
#sidebar-menu > ul > li > a {
    color: rgba(255,255,255,0.58) !important;
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    margin: 1px 10px !important;
    border-radius: 9px !important;
    font-size: 0.855rem !important;
    font-weight: 500 !important;
    transition: background 0.18s ease, color 0.18s ease !important;
    gap: 10px;
}

#sidebar-menu > ul > li > a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.09) !important;
}

/* Active parent item */
#sidebar-menu > ul > li.mm-active > a,
#sidebar-menu > ul > li > a.active {
    color: #fff !important;
    background: rgba(85,110,230,0.38) !important;
}

/* ─── Item icons ────────────────────────────────────────── */
#sidebar-menu ul li a i {
    font-size: 1.1rem !important;
    color: rgba(255,255,255,0.4) !important;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.18s ease !important;
}

#sidebar-menu ul li a:hover i,
#sidebar-menu ul li.mm-active > a i {
    color: #7eb8f7 !important;
}

/* ─── Arrow indicator ───────────────────────────────────── */
#sidebar-menu .has-arrow::after {
    border-color: rgba(255,255,255,0.3) !important;
}

#sidebar-menu .mm-active .has-arrow::after {
    border-color: rgba(255,255,255,0.7) !important;
}

/* ─── Sub-menu container ────────────────────────────────── */
#sidebar-menu ul .sub-menu {
    background: rgba(0,0,0,0.2) !important;
    border-radius: 8px !important;
    margin: 2px 10px 4px !important;
    padding: 4px 0 !important;
}

/* ─── Sub-menu items ────────────────────────────────────── */
#sidebar-menu ul .sub-menu li a {
    color: rgba(255,255,255,0.46) !important;
    padding: 8px 14px 8px 38px !important;
    font-size: 0.82rem !important;
    margin: 1px 6px !important;
    border-radius: 6px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

#sidebar-menu ul .sub-menu li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.07) !important;
}

#sidebar-menu ul .sub-menu li a i {
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.3) !important;
}

#sidebar-menu ul .sub-menu li a:hover i {
    color: #7eb8f7 !important;
}

/* ─── Sidebar footer (version badge) ───────────────────── */
.sidebar-footer-badge {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 9px 18px;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.2);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    letter-spacing: 0.5px;
    background: transparent;  /* sits on top of vertical-menu bg */
    z-index: 1;
}

/* Give the scroll area bottom padding so the last menu item
   never hides behind the pinned footer badge */
#sidebar-menu {
    padding-bottom: 36px;
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════ */

#page-topbar {
    background: #fff !important;
    box-shadow: 0 1px 0 #e9ecef, 0 4px 20px rgba(0,0,0,0.04) !important;
}

/* Topbar icon buttons */
.header-item {
    color: #6c757d !important;
    transition: color 0.15s, background 0.15s !important;
    border-radius: 8px !important;
}

.header-item:hover {
    color: #556ee6 !important;
    background: rgba(85,110,230,0.08) !important;
}

/* Profile avatar ring */
.header-profile-user {
    border: 2px solid rgba(85,110,230,0.25) !important;
    transition: border-color 0.15s !important;
}

#page-header-user-dropdown:hover .header-profile-user {
    border-color: #556ee6 !important;
}

/* Username text */
#page-header-user-dropdown .d-xl-inline-block {
    font-size: 0.855rem !important;
    font-weight: 600 !important;
    color: #495057 !important;
}

/* Topbar dropdown */
.dropdown-menu {
    border: none !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    border-radius: 12px !important;
    padding: 8px !important;
}

.dropdown-item {
    border-radius: 8px !important;
    font-size: 0.855rem !important;
    padding: 8px 14px !important;
    color: #495057 !important;
    transition: background 0.12s ease !important;
}

.dropdown-item:hover {
    background: #f5f6fa !important;
    color: #556ee6 !important;
}

.dropdown-item.text-danger:hover {
    background: #fff0f0 !important;
    color: #f46a6a !important;
}

/* ═══════════════════════════════════════════════════════════
   FILTER BAR (custom per-page filters above the table)
═══════════════════════════════════════════════════════════ */

.gm-filter-select {
    border: 1px solid #e2e5ef;
    border-radius: 8px;
    padding: 6px 30px 6px 12px;
    font-size: 0.82rem;
    color: #495057;
    background: #fff;
    outline: none;
    cursor: pointer;
    appearance: auto;
    height: 34px;
    transition: border-color .18s;
}

.gm-filter-select:focus { border-color: #556ee6; box-shadow: 0 0 0 3px rgba(85,110,230,.1); }

.gm-filter-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gm-filter-icon {
    position: absolute;
    left: 10px;
    color: #adb5bd;
    font-size: 1rem;
    pointer-events: none;
}

.gm-filter-input {
    border: 1px solid #e2e5ef;
    border-radius: 8px;
    padding: 6px 12px 6px 32px;
    font-size: 0.82rem;
    color: #495057;
    background: #fff;
    outline: none;
    height: 34px;
    width: 200px;
    transition: border-color .18s;
}

.gm-filter-input:focus {
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85,110,230,.1);
}

.gm-filter-input::placeholder { color: #adb5bd; }

/* ═══════════════════════════════════════════════════════════
   DATATABLE — global overrides
═══════════════════════════════════════════════════════════ */

/* ── Table base ── */
table.gm-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100% !important;
}

table.gm-table thead tr th {
    background: #f8f9fc;
    color: #495057;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 11px 14px;
    border-bottom: 2px solid #e9ecef;
    border-top: none;
    white-space: nowrap;
}

table.gm-table tbody tr td {
    padding: 10px 14px;
    font-size: 0.855rem;
    color: #495057;
    vertical-align: middle;
    border-bottom: 1px solid #f0f2f7;
    border-top: none;
}

table.gm-table tbody tr:last-child td { border-bottom: none; }

table.gm-table tbody tr:hover td {
    background: #f8f9ff;
}

/* ── Sorting arrows ── */
table.gm-table thead .sorting::after,
table.gm-table thead .sorting_asc::after,
table.gm-table thead .sorting_desc::after {
    opacity: .5;
}

/* ── DataTable toolbar ── */
.gm-dt-toolbar { margin-bottom: 0 !important; }

/* Length select */
.dataTables_length select {
    border: 1px solid #e2e5ef;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 0.82rem;
    color: #495057;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.dataTables_length label {
    font-size: 0.82rem;
    color: #74788d;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Search input */
.dataTables_filter input {
    border: 1px solid #e2e5ef;
    border-radius: 20px;
    padding: 6px 14px 6px 36px;
    font-size: 0.82rem;
    color: #495057;
    background: #f8f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23adb5bd' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    outline: none;
    transition: border-color .18s, background .18s;
    width: 220px;
}

.dataTables_filter input:focus {
    border-color: #556ee6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(85,110,230,.1);
}

.dataTables_filter label {
    font-size: 0;   /* hide "Search:" text — placeholder does the job */
    margin: 0;
}

/* ── Info text ── */
.dataTables_info {
    font-size: 0.8rem;
    color: #74788d;
    padding: 0 !important;
}

/* ── Pagination ── */
.dataTables_paginate .paginate_button {
    border-radius: 7px !important;
    font-size: 0.82rem !important;
    padding: 5px 10px !important;
    margin: 0 2px !important;
    color: #495057 !important;
    border: 1px solid #e2e5ef !important;
    background: #fff !important;
    line-height: 1.4 !important;
    transition: background .15s, color .15s !important;
}

.dataTables_paginate .paginate_button:hover {
    background: #f0f2ff !important;
    color: #556ee6 !important;
    border-color: #556ee6 !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
    background: #556ee6 !important;
    color: #fff !important;
    border-color: #556ee6 !important;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
    opacity: .4 !important;
    cursor: not-allowed !important;
}

/* ── Processing overlay ── */
.dataTables_processing {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.1) !important;
    font-size: 0.82rem !important;
    color: #556ee6 !important;
}

/* ── Action buttons in table ── */
.gm-btn-view   { font-size:.75rem; padding:3px 10px; border-radius:6px; }
.gm-btn-edit   { font-size:.75rem; padding:3px 10px; border-radius:6px; }
.gm-btn-act    { font-size:.75rem; padding:3px 10px; border-radius:6px; }
.gm-btn-del    { font-size:.75rem; padding:3px 10px; border-radius:6px; }

/* ── DataTable footer row ── */
.gm-dt-footer { padding-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */

.footer {
    background: #fff !important;
    border-top: 1px solid #f0f2f7 !important;
    color: #adb5bd !important;
    font-size: 0.82rem !important;
}
