/* =========================
   COMPONENTS
========================= */
.detail-content {
    margin: 10px 0;
    white-space: pre-line;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #5a4d54;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #f8f4f5;
    border-color: #d1d5db;
}

.btn.primary {
    border: 1px solid #4778AF;
    color: #0C335C;
    background: #fff;
}

.btn.primary:hover {
    background: #EEF5FB;
}

.btn.daily-stat-btn {
    border-color: #0C335C;
    background: #0C335C;
    color: #ffffff;
}

.btn.daily-stat-btn:hover {
    background: #082847;
    border-color: #082847;
}

.btn.active {
    background: #2164A8;
    color: #fff;
    border: none;
}

.btn.danger {
    background: linear-gradient(135deg, #2164A8 0%, #0C335C 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(12, 51, 92, 0.14);
}

.btn.danger:hover {
    opacity: 0.92;
}

.table-wrap {
    margin-top: 8px;
    background: #fff;
    border: 1px solid rgba(33, 100, 168, 0.14);
    border-radius: 18px;
    overflow-x: auto;
    box-shadow: 0 16px 30px rgba(64, 37, 47, 0.06);
}

.data-table {
    width: 100%;
    font-size: 14px;
    color: #374151;
    border-collapse: collapse;
}

.data-table thead {
    background: #F5F8FC;
    color: #334155;
}

.data-table tbody tr:hover {
    background: #F5F8FC;
}

.data-table tfoot td {
    color: #222 !important;
    font-weight: 700;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 18px;
    font-weight: 700;
    display: inline-block;
}

.btn.btn-purchase-add,
.btn[onclick*="addPurchaseOrderRow"] {
    background: #f97316;
    border-color: #f97316;
    color: #ffffff;
}

.btn.btn-purchase-add:hover,
.btn[onclick*="addPurchaseOrderRow"]:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
}

.btn.purchase-order-remove,
.btn[onclick*="removePurchaseOrderRow"] {
    background: #e11d48;
    border-color: #e11d48;
    color: #ffffff;
}

.btn.purchase-order-remove:hover,
.btn[onclick*="removePurchaseOrderRow"]:hover {
    background: #be123c;
    border-color: #be123c;
    color: #ffffff;
}

.page-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    padding-top: 12px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
}

#pagination-box {
    display: flex;
    gap: 6px;
}

#pagination-box .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

#pagination-box .page-btn:hover {
    background: #f8f4f5;
    border-color: #d1d5db;
}

#pagination-box .page-btn.is-active {
    background: linear-gradient(135deg, #2164A8 0%, #0C335C 100%);
    border-color: #0C335C;
    color: #fff;
}

#pagination-box .page-btn:first-child,
#pagination-box .page-btn:last-child {
    font-weight: 700;
}

.rows-per-page {
    font-size: 15px;
    color: #111111;
}

.rows-per-page select {
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #eee;
    color: #111111;
    font-size: 15px;
    height: 36px;
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
    white-space: nowrap;
}

.data-table tbody {
    color: #111111;
}

.empty-row td {
    text-align: center;
    padding: 32px 12px;
    color: #9ca3af;
}

.sub-bg {
    background: rgba(255, 255, 255, 0.94);
    padding: 18px;
    border-radius: 22px;
    min-height: 80vh;
    border: 1px solid rgba(33, 100, 168, 0.12);
    box-shadow: 0 20px 34px rgba(64, 37, 47, 0.08);
}

.detail-card {
    color: #111111;
}

.page-title {
    margin: 0 0 8px 0;
    color: #0f172a;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    padding: 16px 20px;
    border-radius: 18px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(93, 124, 255, 0.08) 0%, rgba(33, 100, 168, 0.08) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 250, 251, 0.96) 100%);
    border: 1px solid rgba(33, 100, 168, 0.12);
    box-shadow: 0 10px 22px rgba(64, 37, 47, 0.07);
}

.dashboard-hero::after {
    display: none;
}

.dashboard-hero-main,
.dashboard-hero-side {
    position: relative;
    z-index: 1;
}

.dashboard-hero-main {
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 100, 168, 0.2);
    color: #0C335C;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-hero-copy {
    max-width: 720px;
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(132px, 1fr));
    gap: 10px;
    width: min(360px, 100%);
}

.dashboard-stat-card {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(33, 100, 168, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 18px rgba(79, 46, 57, 0.06);
}

.dashboard-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0C335C;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-stat-value {
    margin-top: 6px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-stat-sub {
    margin-top: 5px;
    color: #8c7a82;
    font-size: 11px;
    font-weight: 600;
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(33, 100, 168, 0.14);
    background: #F5F8FC;
}

.dashboard-toolbar-left,
.dashboard-toolbar-right {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.dashboard-cluster {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.dashboard-cluster-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0C335C;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-cluster-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.heading-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.heading-with-icon i {
    width: 16px;
    color: #0C335C;
    font-size: 13px;
    text-align: center;
}

.search-box {
    gap: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.checked-count {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box input {
    height: 38px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid #eee;
    font-size: 13px;
}

@media (max-width: 960px) {
    .dashboard-hero,
    .dashboard-toolbar {
        padding: 16px;
    }

    .dashboard-hero {
        flex-direction: column;
    }

    .dashboard-hero-stats {
        width: 100%;
    }

    .dashboard-toolbar {
        align-items: stretch;
    }

    .dashboard-toolbar-left,
    .dashboard-toolbar-right {
        width: 100%;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 22px;
    }

    .dashboard-hero,
    .dashboard-toolbar {
        padding: 14px;
        border-radius: 16px;
    }

    .dashboard-stat-card {
        border-radius: 14px;
    }
}

/* Compact page header: show only the page name. */
.dashboard-hero,
.board-hero,
.board-detail-hero,
.profile-hero,
.keyword-map-hero,
.purchase-log-hero,
.slot-detail-hero,
.slot-stat-hero,
.purchase-settlement-hero {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 0 !important;
    margin-bottom: 8px !important;
    padding: 12px 16px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(33, 100, 168, 0.14) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

.board-inner,
.board-detail-inner,
.profile-inner,
.keyword-map-inner,
.purchase-log-inner,
.slot-detail-inner,
.slot-stat-inner,
.purchase-settlement-inner {
    gap: 8px !important;
}

.dashboard-hero-tag,
.dashboard-hero-copy,
.dashboard-hero-side,
.hero-badge,
.section-badge,
.purchase-log-state-row,
.purchase-log-metrics,
.slot-detail-state-row,
.slot-detail-metrics,
.slot-stat-state-row,
.slot-stat-metrics,
.purchase-settlement-state-row,
.purchase-settlement-metrics {
    display: none !important;
}

.dashboard-hero-main,
.purchase-log-title-group,
.slot-detail-title-group,
.slot-stat-title-group,
.purchase-settlement-title-group {
    display: block !important;
    min-width: 0 !important;
}

.dashboard-hero .page-title,
.board-hero .page-title,
.board-detail-hero .page-title,
.profile-hero .page-title,
.keyword-map-hero .page-title,
.purchase-log-hero .page-title,
.slot-detail-hero .page-title,
.slot-stat-hero .page-title,
.purchase-settlement-hero .page-title {
    margin: 0 !important;
    font-size: 24px !important;
    line-height: 1.25 !important;
}

/* Litepicker */
.litepicker .container__days .day-item.is-locked {
    color: #d0d0d0 !important;
    background-color: #f8f8f8 !important;
    cursor: not-allowed !important;
    text-decoration: line-through;
    opacity: 0.4;
}

.litepicker .container__days .day-item:not(.is-locked) {
    color: #333 !important;
    font-weight: 500;
}

.litepicker .container__days .day-item:not(.is-locked):hover {
    font-weight: 600;
}

.litepicker .container__days .day-item.is-start-date,
.litepicker .container__days .day-item.is-end-date {
    background: linear-gradient(90deg, #2164A8, #0C335C) !important;
    color: white !important;
    font-weight: 700 !important;
}

.litepicker .container__days .day-item.is-in-range {
    background-color: #D9E7F3 !important;
    color: #0C335C !important;
    font-weight: 600;
}

.litepicker .container__days .day-item.is-today {
    font-weight: 700;
}

.litepicker .container__days .day-item.is-today.is-locked {
    opacity: 0.3;
}

.litepicker .container__days .day-item:not(.is-locked):nth-child(7n),
.litepicker .container__days .day-item:not(.is-locked):nth-child(7n+1) {
    color: #d32f2f;
}

.litepicker .container__days .day-item.is-locked:nth-child(7n),
.litepicker .container__days .day-item.is-locked:nth-child(7n+1) {
    color: #ffcdd2 !important;
}

.litepicker .container__days .day-item.is-locked {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        #f0f0f0 2px,
        #f0f0f0 4px
    );
}

.litepicker .container__days .day-item:not(.is-locked):not(.is-start-date):not(.is-end-date):not(.is-in-range) {
    border: 1px solid #e0e0e0;
}

.litepicker .container__tooltip {
    display: none !important;
}

.text-hover-tooltip,
.tooltip-wrap .tooltip {
    display: none !important;
}

select {
    border-radius: 18px !important;
}

a {
    text-decoration: none;
}
