/*
  Theme Name:   DealGrid
  Theme URI:    https://dealgrid.com/
  Description:  DealGrid theme created by Austin Web & Design
  Author:       Austin Web & Design
  Author URI:   https://austinwebanddesign.com/
  Template:     twentytwentyfive
  Version:      1.0
  License:      GNU General Public License v2 or later
  License URI:  https://www.gnu.org/licenses/gpl-2.0.html
  Text Domain:  dealgrid-theme
*/

/* ========== Base ========== */
html, body { height: 100%; }
body { font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif; background: #F9FAFB; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100%; }
main.wp-block-group { flex: 1 0 auto; }
footer.wp-block-template-part { flex-shrink: 0; }
body.admin-role .wp-site-blocks { min-height: calc(100% - 32px); }
body.wp-singular { background: #F9FAFB; }
.fw-bold { font-weight: 600 !important; }

/* ========== Header ========== */
header.wp-block-template-part > .wp-block-group { background: linear-gradient(90deg, #1D4ED8 0%, #3B82F6 100%); }
.wp-block-site-logo img.custom-logo { max-width: 120px; }

/* ========== Dashboard Shell ========== */
#dealgrid-dashboard { background: #FFFFFF; border-radius: 8px; padding: 30px 40px 50px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); margin: 30px 25px; }
#dealgridTabsContent .navbar-text.fw-semibold { color: #1E3A8A !important; }
#dealgridTabsContent h2.mb-3 { font-size: 26px; font-weight: 500; color: #1E3A8A; }
#store-filters label.fw-semibold.mb-0.me-2 { font-size: 18px; color: #1E3A8A; }

/* ========== Tabs ========== */
.nav-tabs .nav-link { background: #E0E7FF; }
.nav-tabs .nav-link.active { background: #2563EB; color: #fff; }
#dealgridTabs { border-bottom: 1px solid #ccc; gap: 12px; display: flex; flex-wrap: wrap; padding: .5rem 1rem; border-radius: 8px 8px 0 0; }
#dealgridTabs .nav-link { background-color: #E0E7FF; border: 1px solid transparent; color: #1E3A8A; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 8px 25px !important; font-weight: 500; transition: all .2s ease-in-out; box-shadow: 0 0 0 transparent; }
#dealgridTabs .nav-link i { font-size: 1.1rem; margin-right: .5rem; color: #1E3A8A; }
#dealgridTabs .nav-link.active { background-color: #2563EB; color: #fff; border-color: #2563EB; box-shadow: 0 2px 6px rgba(37, 99, 235, .2); }
#dealgridTabs .nav-link.active i { color: #fff; }
#dealgridTabs .nav-link:focus { outline: 2px solid #2563EB; outline-offset: 2px; }
#dealgridTabs .nav-link:hover:not(.active) { background-color: #F3F6FB; border-color: #D1D5DB; }
#dealgridTabs .nav-link:hover:not(.active) i { color: #1E3A8A; }
@media (max-width:768px) {
  #dealgridTabs { flex-direction: column; gap: 6px; }
}

/* ========== Layout: Metrics Grid & Cards ========== */
.d-flex > .metrics-wrapper { flex: 1 1 100%; min-width: 0; }
.metrics-wrapper { display: grid; gap: 12px; align-items: stretch; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* bump up to 3 cols on md+, 4 cols on xl+ */

/* @media (min-width: 992px)  { .metrics-wrapper { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .metrics-wrapper { grid-template-columns: repeat(4, minmax(0, 1fr)); } } */

.metric-card { display: flex; min-height: 200px; }
.metric-card .card-body { display: flex; flex-direction: column; }
.metric-card .card-title { margin-bottom: .5rem; font-size: 15px; color: #1E3A8A; }
.metric-card .metric-table { flex: 1 1 auto; min-height: 0; }
.metric-card.card.shadow-sm.h-100 { display: flex; flex-direction: column; height: 100%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); --bs-card-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); --bs-card-border-color: #efefef; }

/* ========== Tables & Tabulator (General) ========== */
.tabulator .tabulator-header .tabulator-header-contents { background-color: #F9FAFB; }
.tabulator .tabulator-header .tabulator-col { background-color: #E0E7FF; border-bottom: 1px solid #D1D5DB; color: #1E3A8A; font-weight: 600; font-size: .85rem; text-align: center; }
.tabulator-row { background-color: #fff; border-bottom: 1px solid #1C3781; }
.tabulator-row.tabulator-row-even { background-color: #F9FAFB; }
.tabulator-row:hover { background-color: #F3F6FB; }
.tabulator-row .bg-primary-subtle { background-color: #E0E7FF !important; }
.tabulator-row .bg-warning-subtle { background-color: #FEF9C3 !important; }
.tabulator-row .bg-info-subtle { background-color: #CCFBF1 !important; }
.tabulator-row .bg-secondary-subtle { background-color: #F3F4F6 !important; }
.tabulator-cell { white-space: normal !important; word-break: break-word; }
#daily-log-grid .tabulator-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== Tables & Tabulator (Per-Grid Overrides) ========== */
#daily-log-grid, #daily-log-summary, #sales-manager-performance, #finance-manager-performance, #sales-person-performance, #stock-type-performance { padding: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
#daily-log-grid .tabulator-table { font-size: .9rem; color: #1F2937; }
#daily-log-grid .tabulator-header .tabulator-col { background-color: #F9FAFB; color: #374151; font-weight: 600; font-size: .85rem; border-bottom: 1px solid #E5E7EB; text-align: center; }
#daily-log-grid .tabulator-row { background-color: #fff; border-bottom: 1px solid #E5E7EB; transition: background-color .2s; }
#daily-log-grid .tabulator-row.tabulator-row-even { background-color: #F9FAFB; }
#daily-log-grid .tabulator-row:hover { background-color: #F3F6FB; }
#daily-log-grid .tabulator-cell.tabulator-row-header.tabulator-row-handle { padding: 0; }
#daily-log-grid .tabulator-cell { padding: 6px 10px; height: auto; vertical-align: middle; line-height: 1; }
#daily-log-grid .value-positive, .tabulator-cell .value-positive { color: #10B981; font-weight: 600; }
#daily-log-grid .value-negative, .tabulator-cell .value-negative { color: #EF4444; font-weight: 600; }

/* Tabulator inside metric cards */
.metric-card .tabulator, .metric-card .tabulator-tableholder { height: auto !important; max-height: none !important; flex: 1 1 auto; min-height: 0; }
.metric-card .tabulator-header { flex: 0 0 auto; }
.metric-card .tabulator-table { height: auto; }
.metric-card .tabulator { flex: 1; height: 100% !important; border-bottom: 0; border-left: 0; border-right: 0; }
.metric-card .tabulator-cell { padding: 0 !important; }
.metric-card .tabulator-cell > div { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.metric-card .tabulator-row.tabulator-selectable:hover { background-color: #fff; }
.metric-card .tabulator-row.tabulator-row-even.tabulator-selectable:hover { background-color: #F9FAFB; }
.metric-card .tabulator-col:first-child, .metric-card .tabulator-row .tabulator-cell:first-child { border-left: 1px solid #aaa !important; }
.metric-card .tabulator-row .tabulator-cell:first-child { --bs-card-bg: #fff; }

/* ========== Forms & Buttons ========== */
.form-label { font-size: .9rem; font-weight: 600; color: #1F2937; margin-bottom: .25rem; }
.form-control, .form-select { border-radius: 8px; border: 1px solid #D1D5DB; font-size: .875rem; padding: .5rem .75rem; color: #111827; transition: border-color .2s; }
.form-control:focus, .form-select:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); outline: none; }
.form-check-input { width: 1rem; height: 1rem; margin-top: .125rem; }
.form-check-input:checked { background-color: #2563EB; border-color: #2563EB; }
.form-check-label { font-weight: 500 !important; font-size: .875rem; color: #1F2937; margin-left: .5rem; margin-bottom: 0; display: flex; align-items: center; }
.btn-primary { background-color: #2563EB; border-color: #2563EB; font-weight: 600; font-size: .9rem; padding: .5rem 1.25rem; border-radius: 8px; }
.btn-primary:hover { background-color: #1D4ED8; border-color: #1D4ED8; }
.btn-secondary { background-color: #F9FAFB; border: 1px solid #D1D5DB; color: #374151; }
.btn-secondary:hover { background-color: #F3F4F6; border-color: #D1D5DB; }

/* ========== Selects (Custom) ========== */
.awd-select, .range-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; display: inline-block; width: 100%; max-width: 320px; font: 500 15px/1.4 "Poppins", system-ui, sans-serif; color: #0F172A; background-color: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 1px rgba(0, 0, 0, .04); padding: 10px 42px 10px 14px; background-image: url('/wp-content/themes/dealgrid/images/chevron.svg'); background-repeat: no-repeat; background-position: right 12px center; background-size: 11px 7px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.awd-select:hover, .range-select:hover { border-color: #DBE3EE; }
.awd-select:focus, .range-select:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 4px rgba(37, 99, 235, .18); }
.awd-select:disabled, .range-select:disabled { opacity: .6; cursor: not-allowed; }
.select, .awd-select, .range-select { background-clip: padding-box; }
.awd-select[multiple], .range-select[multiple] { background-image: none; padding-right: 14px; height: auto; }
@media (prefers-color-scheme:dark) {
  .awd-select, .range-select { background-color: #2563EB; color: #E5E7EB; background-image: url('/wp-content/themes/dealgrid/images/chevron.svg'); border-color: transparent; }
}
@media (prefers-reduced-motion:reduce) {
  .awd-select, .range-select { transition: none; }
}

/* ========== Filters: Store Pills ========== */
/*
#store-filters .form-check { position: relative; margin: 0; padding-left: 0; }
#store-filters .form-check-input { position: absolute; opacity: 0; pointer-events: none; }
#store-filters .form-check-label { display: inline-flex; align-items: center; padding: .4rem .9rem; font-size: .9rem; font-weight: 500; color: #374151; background-color: #F3F4F6; border: 1px solid #D1D5DB; border-radius: 8px; cursor: pointer; transition: all .25s ease; }
#store-filters .form-check-input:checked + .form-check-label { background-color: #2563EB; border-color: #2563EB; color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
#store-filters .form-check-label:hover { background-color: #E5E7EB; color: #1E3A8A; }
#store-filters .form-check-input:focus + .form-check-label { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
@media (prefers-color-scheme:dark) {
  #store-filters .form-check-label { background-color: #1F2937; border-color: #374151; color: #D1D5DB; }
  #store-filters .form-check-input:checked + .form-check-label { background-color: #2563EB; border-color: #2563EB; color: #fff; }
}

/* ========== Filters: Clear Button ========== */
/*
#clear-store-filters { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem; font-size: .9rem; font-weight: 500; font-family: "Poppins", system-ui, sans-serif; color: #374151; background-color: transparent; border: 1px solid #D1D5DB; border-radius: 8px; cursor: pointer; transition: all .25s ease; }
#clear-store-filters:hover { background-color: #F3F4F6; border-color: #9CA3AF; color: #111827; }
#clear-store-filters:focus { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
#clear-store-filters::before { content: "✕"; font-size: .9rem; line-height: 1; color: #6B7280; transition: color .2s ease; }
#clear-store-filters:hover::before { color: #111827; }
@media (prefers-color-scheme:dark) {
  #clear-store-filters { color: #2563EB; border-color: #374151; }
  #clear-store-filters:hover { background-color: #1F2937; color: #fff; border-color: #4B5563; }
  #clear-store-filters::before { color: #9CA3AF; }
  #clear-store-filters:hover::before { color: #fff; }
}
*/
/* ========== Filters: Stock Type Pills ========== */
#stock-type-filters { display: flex; flex-wrap: wrap; gap: .5rem; font-family: "Poppins", system-ui, sans-serif; }
#stock-type-filters label { position: relative; cursor: pointer; font-size: .9rem; font-weight: 500; color: #374151; }
#stock-type-filters input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
#stock-type-filters input[type="checkbox"] + label, #stock-type-filters label { display: inline-flex; align-items: center; padding: .4rem .9rem; border: 1px solid #D1D5DB; border-radius: 9999px; background-color: #F3F4F6; transition: all .25s ease; }
#stock-type-filters input[type="checkbox"]:checked + label, #stock-type-filters label:has(input:checked) { background-color: #2563EB; border-color: #2563EB; color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
#stock-type-filters label:hover { background-color: #E5E7EB; color: #2563EB; }
#stock-type-filters input[type="checkbox"]:focus + label, #stock-type-filters label:has(input:focus) { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }
@media (prefers-color-scheme:dark) {
  #stock-type-filters label { background-color: #1F2937; border-color: #374151; color: #D1D5DB; }
  #stock-type-filters input[type="checkbox"]:checked + label, #stock-type-filters label:has(input:checked) { background-color: #2563EB; border-color: #2563EB; color: #fff; }
}

/* ========== Date Input ========== */
#daily-log-date.form-control { width: auto; min-width: 180px; font-family: "Poppins", system-ui, sans-serif; font-size: .95rem; font-weight: 500; color: #1F2937; background-color: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 8px; padding: .45rem 1.1rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 1px rgba(0, 0, 0, .04); cursor: pointer; transition: all .2s ease; }
#daily-log-date.form-control::placeholder { color: #9CA3AF; font-weight: 400; }
#daily-log-date.form-control:hover { border-color: #CBD5E1; background-color: #F9FAFB; }
#daily-log-date.form-control:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); outline: none; }
#daily-log-date.form-control:disabled { background-color: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
@media (prefers-color-scheme:dark) {
  #daily-log-date.form-control { background-color: #2563EB; border-color: #2563EB; color: #E5E7EB; }
  #daily-log-date.form-control::placeholder { color: #9CA3AF; }
  #daily-log-date.form-control:hover { background-color: #1D4ED8; border-color: #4B5563; }
  #daily-log-date.form-control:focus { border-color: #60A5FA; box-shadow: 0 0 0 3px rgba(96, 165, 250, .3); }
}

/* ========== Modal ========== */
.modal-content { border-radius: 12px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1); border: none; max-width: 840px; margin: 0 auto; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #E5E7EB; }
.modal-title { font-size: 1.25rem; color: #1E293B; }
.modal-body { padding: 1.5rem; background-color: #FFFFFF; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid #E5E7EB; }
#saleModal { background: #000; }

@media screen and (max-width: 588px) {
	  #dealgridTabs .nav-link {
  padding: 15px !important;
}
}