/* ========================= GLOBAL PATTERNS USED =========================
 * Header: new-header, new-animated-line, new-header-icon, new-header-subtitle, new-help-btn-header
 * Main Tabs: new-tabs, new-tab (with data-theme="info")
 * Sub-tabs: new-tabs secondary, new-tab (with data-theme="info")
 * Content Cards: new-content-card, new-content-card-header, new-content-card-title
 * All global styles from: customize.css
 ========================================================================== */

/* Ana Container */
.stok_dashboard-container {
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
}

/* Tab Content */
.stok_dashboard-tab-content {
    display: none;
}

.stok_dashboard-tab-content.active,
.stok_dashboard-tab-content:first-child {
    display: block;
}

/* Buttons */
.stok_dashboard-btn {
    padding: 8px 16px;
    background: #797bf2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stok_dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(121, 123, 242, 0.4);
}

.stok_dashboard-btn-secondary {
    background: transparent;
    border: 2px solid #797bf2;
}

.stok_dashboard-btn-success {
    background: #10b981;
}

.stok_dashboard-btn-warning {
    background: #f59e0b;
}

.stok_dashboard-btn-small {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #797bf2;
    color: #797bf2;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.stok_dashboard-btn-small:hover {
    background: #797bf2;
    color: #fff;
}

/* Grid Layout */
.stok_dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* KPI Cards */
.stok_dashboard-card {
    position: relative;
}

.stok_dashboard-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
    opacity: 0.7;
    color: #797bf2;
}

.stok_dashboard-card-header {
    margin-bottom: 15px;
    padding-left: 35px;
}

.stok_dashboard-card-header h3 {
    font-size: 1rem;
    color: #ccc;
    font-weight: 500;
}

.stok_dashboard-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #797bf2;
    margin: 10px 0;
    padding-left: 35px;
}

.stok_dashboard-card-info {
    font-size: 0.8rem;
    color: #999;
    padding-left: 35px;
}

/* Status Indicators */
.stok_dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stok_dashboard-status-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.stok_dashboard-status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.stok_dashboard-status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Alert Box (wrapped in new-content-card) */
.stok_dashboard-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.stok_dashboard-alert-header h3 {
    font-size: 1rem;
    color: #f59e0b;
}

.stok_dashboard-alert-list {
    list-style: none;
}

.stok_dashboard-alert-item {
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    margin-bottom: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Charts (wrapped in new-content-card) */
.stok_dashboard-chart-container {
    padding: 20px 0;
}

/* Table */
.stok_dashboard-table-container {
    overflow-x: auto;
}

.stok_dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.stok_dashboard-table th,
.stok_dashboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3b3b41;
}

.stok_dashboard-table th {
    background: rgba(121, 123, 242, 0.1);
    color: #797bf2;
    font-weight: 600;
    font-size: 0.85rem;
}

.stok_dashboard-table tr:hover {
    background: rgba(121, 123, 242, 0.05);
}

/* Progress Bar */
.stok_dashboard-progress {
    width: 100%;
    height: 8px;
    background: #3b3b41;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.stok_dashboard-progress-bar {
    height: 100%;
    background: #797bf2;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stok_dashboard-progress-bar.warning {
    background: #f59e0b;
}

.stok_dashboard-progress-bar.danger {
    background: #ef4444;
}

/* Help Modal */
.stok-dashboard-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.stok-dashboard-modal-content {
    background: #323236;
    border-radius: 15px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #3b3b41;
    position: relative;
}

.stok-dashboard-modal-header {
    background: rgba(59, 59, 65, 0.95);
    padding: 20px 25px;
    border-bottom: 1px solid #3b3b41;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.stok-dashboard-modal-header h3 {
    font-size: 1.3rem;
    color: #797bf2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stok-dashboard-modal-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.stok-dashboard-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.stok-dashboard-modal-body {
    padding: 30px;
}

.stok-dashboard-help-section {
    margin-bottom: 25px;
}

.stok-dashboard-help-section h4 {
    font-size: 1.1rem;
    color: #797bf2;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stok-dashboard-help-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 10px;
}

.stok-dashboard-help-section ul {
    list-style: none;
    padding-left: 0;
}

.stok-dashboard-help-section ul li {
    padding: 6px 0;
    color: #ccc;
    line-height: 1.5;
}

.stok-dashboard-help-section ul li:before {
    content: "• ";
    color: #797bf2;
    font-weight: bold;
    display: inline-block;
    width: 1em;
}

/* Filter Grid (for advanced filters in new-panel) */
.stok_dashboard-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stok_dashboard-filter-item {
    display: flex;
    flex-direction: column;
}

.stok_dashboard-filter-label {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 8px;
    font-weight: 500;
}

.stok_dashboard-filter-input,
.stok_dashboard-filter-select {
    padding: 8px 12px;
    border: 2px solid #3b3b41;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: #323236;
    color: #fff;
}

.stok_dashboard-filter-input:focus,
.stok_dashboard-filter-select:focus {
    outline: none;
    border-color: #797bf2;
    box-shadow: 0 0 0 3px rgba(121, 123, 242, 0.2);
}

/* Report Results (wrapped in new-content-card) */
.stok_dashboard-report-header h3 {
    font-size: 1.3rem;
    color: #797bf2;
}

.stok_dashboard-report-actions {
    display: flex;
    gap: 10px;
}

/* Detail Button */
.stok_dashboard-detail-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #797bf2;
    color: #797bf2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.stok_dashboard-detail-btn:hover {
    background: #797bf2;
    color: #fff;
    transform: scale(1.05);
}

/* Badges */
.stok_dashboard-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.stok_dashboard-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.stok_dashboard-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.stok_dashboard-badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Main-filters Select Width Control */
.main-filters {
    width: 200px !important;
}

.select2-container:has(.main-filters),
.main-filters + .select2-container {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
}

.select2-container:has(.main-filters) .select2-selection,
.main-filters + .select2-container .select2-selection {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
}

.stok_dashboard-filter-item:has(.main-filters) {
    flex: none !important;
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
}

.stok_dashboard-filter-item:has(.main-filters) .control,
.stok_dashboard-filter-item:has(.main-filters) .select {
    width: 200px !important;
    max-width: 200px !important;
}

.stok_dashboard-filter-grid:has(.main-filters) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    align-items: flex-start !important;
}

.stok_dashboard-filter-item:has(.main-filters) {
    justify-self: start !important;
    align-self: start !important;
}

/* Dark Theme Support for KPI Cards */
body.is-dark .stok_dashboard-card {
    background: rgb(64 65 82);
    backdrop-filter: blur(10px);
    border: 1px solid #3b3b41;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

body.is-dark .stok_dashboard-card:hover {
    border-color: #4b4b51;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

body.is-dark .stok_dashboard-card-header h3 {
    color: #e0e0e0;
}

body.is-dark .stok_dashboard-card-value {
    color: #797bf2;
}

body.is-dark .stok_dashboard-card-info {
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .stok_dashboard-container {
        padding: 10px;
    }

    .stok_dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stok_dashboard-card {
        padding: 15px;
    }

    .stok_dashboard-card-value {
        font-size: 1.5rem;
    }

    .stok_dashboard-chart-container {
        padding: 15px;
    }

    .stok_dashboard-filter-grid {
        grid-template-columns: 1fr;
    }

    .stok-dashboard-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
