/* 
   Thiết kế hệ thống Design System MODERN DASHBOARD cho QUẢN LÝ KHO NỆM 2026
   Phong cách: Dark Sidebar, Top Header, tinh tế, hiện đại.
*/

:root {
    /* Bảng màu Modern */
    --sidebar-bg: #022c22;
    /* Deep Dark Green */
    --sidebar-text: #ffffff;
    /* pure White text */
    --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: rgba(255, 255, 255, 0.2);
    --sidebar-active-text: #ffffff;

    --sidebar-width: 260px;
    /* Added Sidebar Width */

    --primary-color: #10b981;
    /* Emerald 500 - Matches Green Theme */
    --primary-hover: #059669;
    /* Emerald 600 */
    --primary-light: #eff6ff;

    --bg-main: #f1f5f9;
    /* Slate 100 */
    --bg-card: #ffffff;

    --text-heading: #1e293b;
    --text-body: #475569;
    --text-muted: #94a3b8;

    --border-soft: #e2e8f0;
    --danger-color: #f43f5e;
    /* Rose 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --success-color: #10b981;
    /* Emerald 500 */

    /* Shadows Premium */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 8px;
    --radius-lg: 12px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-height);
}

.logo-box {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-bg);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.75) !important;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.25s;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link i {
    width: 20px;
    margin-right: 14px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #ffffff !important;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: var(--primary-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Sidebar Responsive */
@media (max-width: 992px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }

    .sidebar.active {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    /* Fix: Push content to right on Desktop */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Toggle Button */
#sidebarToggleMobile {
    display: none;
    /* Hidden on Desktop by default */
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
}

@media (max-width: 992px) {
    #sidebarToggleMobile {
        display: block;
        /* Show on Mobile/Tablet */
    }
}

/* Top Header */
.top-header {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.search-global {
    background: #f1f5f9;
    border: 1px solid transparent;
    padding: 8px 16px 8px 40px;
    border-radius: 8px;
    width: 300px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.search-global:focus {
    background: #ffffff;
    border-color: #e2e8f0;
    width: 350px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Main Content Area */
.main-content {
    padding: 24px;
}

/* Content Container (Card like) */
.content-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
}

/* Action Bar (Filters + Add button) */
.action-bar {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
}

.filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 320px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: #f1f5f9;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.premium-search {
    position: relative;
    width: 300px;
}

.premium-search input {
    width: 100%;
    background: #f1f5f9;
    border: none;
    padding: 10px 16px 10px 42px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-body);
    outline: none;
    transition: all 0.2s ease;
}

.premium-search input:focus {
    background: #e2e8f0;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.premium-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.premium-search input:focus+i {
    color: var(--primary-color);
}

/* Premium Table */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    background: #f8fafc;
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-soft);
}

.premium-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.9rem;
    color: var(--text-body);
}

.premium-table tr:hover {
    background-color: #f8fafc;
}

.sku-text {
    font-weight: 700;
    color: var(--primary-color);
}

/* Card View Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 24px;
}

.data-card {
    background: white;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.card-sku {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.card-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.card-info-label {
    color: var(--text-muted);
}

/* Action Bar Refinement - Exact Match with Screenshot */
.action-bar {
    padding: 1rem 1.5rem !important;
}

.search-box input {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    height: 38px;
    font-size: 0.82rem;
}

.premium-select-v2 {
    background: #ffffff;
    height: 38px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0 32px 0 12px;
    /* Extra padding for custom arrow */
    font-size: 0.875rem;
    color: var(--text-heading);
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.2s;
}

.premium-select-v2:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.view-toggle-group {
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    display: flex;
    gap: 2px;
}

.view-toggle-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}

.view-toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

/* Table Action Buttons - Square Rounded */
.btn-action-round {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    /* Rounded square like in the image */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.btn-action-edit {
    background-color: #3b82f6;
}

.btn-action-edit:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-action-delete {
    background-color: #f43f5e;
}

.btn-action-delete:hover {
    background-color: #e11d48;
    transform: translateY(-1px);
}

/* Card View - Exact Match with Image 3 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 1.5rem;
}

.data-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    position: relative;
    transition: transform 0.2s;
}

.data-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-tag-sku {
    background: #eff6ff;
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.card-status-badge {
    position: absolute;
    top: 16px;
    right: 16px;
}

.card-product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 12px 0 20px 0;
    line-height: 1.4;
}

.card-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-group {
    flex: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.stat-value.highlight-blue {
    color: #2563eb;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 8px;
}

.footer-id-text {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Badges */
.badge {
    padding: 2px 10px;
    /* Slimmer badges like in image */
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.badge-success {
    background-color: #ecfdf5;
    color: #059669;
}

.badge-warning {
    background-color: #fffbeb;
    color: #d97706;
}

.badge-danger {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Table Sort Icon - Positioned on Left */
.premium-table th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.premium-table th:hover {
    background-color: #f8fafc;
}

.premium-table th i {
    font-size: 0.7rem;
    margin-right: 8px;
    /* Gap after icon */
    color: #cbd5e1;
    /* Grey for inactive */
    transition: all 0.2s;
    width: 12px;
    display: inline-block;
    text-align: center;
}

.premium-table th.active-sort {
    color: #1e293b;
    font-weight: 700;
}

.premium-table th.active-sort i {
    color: #3b82f6;
    /* Blue for active */
    transform: scale(1.1);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    color: var(--text-body);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-excel {
    background: #f0fdf4;
    /* Light Green */
    border: 1px solid #dcfce7;
    color: #166534;
    /* Dark Green text */
}

.btn-excel:hover {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.btn-edit {
    background: #eff6ff;
    color: #3b82f6;
}

.btn-delete {
    background: #fff1f2;
    color: #f43f5e;
}

/* Tabs System */
.tab-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
}

.tab-item {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: #64748b;
}

.tab-item.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-item.btn-view-mode {
    padding: 6px;
    width: 34px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 24px 32px;
    border-radius: 16px;
    width: 480px;
    max-width: 95%;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    border: 1px solid #f1f5f9;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

/* Form Styles for Premium Look */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-heading);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
    width: 100%;
}

.item-name {
    flex: 1;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--bg-hover);
}

/* Responsive cho bảng nhập liệu trong Modal */
@media (max-width: 768px) {

    .purchase-items-table,
    .purchase-items-table thead,
    .purchase-items-table tbody,
    .purchase-items-table th,
    .purchase-items-table td,
    .purchase-items-table tr {
        display: block;
    }

    .purchase-items-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .purchase-items-table tr {
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        margin-bottom: 1.5rem;
        padding: 12px;
        background: #f8fafc;
        position: relative;
    }

    .purchase-items-table td {
        border: none;
        border-bottom: 1px solid #edf2f7;
        position: relative;
        padding-left: 40% !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        text-align: left !important;
        min-height: 48px;
    }

    .purchase-items-table td:last-child {
        border-bottom: 0;
        padding-left: 5px !important;
        text-align: center !important;
    }

    .purchase-items-table td:before {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-muted);
        content: attr(data-label);
        text-transform: uppercase;
    }

    .item-row input {
        background: white !important;
    }

    /* Đảm bảo ô nhập liệu không bị tràn trên mobile cực nhỏ */
    .autocomplete-container>div {
        flex-wrap: wrap;
    }

    @media (max-width: 480px) {
        .autocomplete-container>div {
            flex-direction: column;
            gap: 5px !important;
        }

        .item-sku {
            width: 100% !important;
            text-align: left !important;
        }
    }

    .autocomplete-results {
        position: fixed;
        left: 5%;
        right: 5%;
        top: 20%;
        width: 90%;
        max-height: 50vh;
    }
}

/* Button Add Row Premium */
.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1rem 0 2rem;
    width: fit-content;
}

.btn-add-row:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.1);
    transform: translateY(-2px);
}

.btn-add-row i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    min-width: 320px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 16px;
    position: relative;
    overflow: hidden;
    animation: toastBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    /* Subtle progress bar */
}

.toast-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: currentColor;
    /* Takes color from parent */
    animation: toastProgress 3.5s linear forwards;
}

.toast-success {
    color: #10b981;
    border-left: 4px solid #10b981;
}

.toast-error {
    color: #f43f5e;
    border-left: 4px solid #f43f5e;
}

.toast-warning {
    color: #f59e0b;
    border-left: 4px solid #f59e0b;
}

.toast-info {
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.toast-content {
    flex: 1;
    color: var(--text-heading);
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.875rem;
    opacity: 0.8;
    line-height: 1.4;
}

.modal-header-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .modal-header-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .modal-header-grid {
        grid-template-columns: 1fr;
    }
}


.toast-close {
    cursor: pointer;
    opacity: 0.4;
    transition: 0.2s;
    padding: 4px;
}

.toast-close:hover {
    opacity: 1;
}

.toast.fade-out {
    animation: toastFadeOut 0.4s ease forwards;
}

@keyframes toastBounceIn {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* Advanced Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px !important;
    }

    .filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        /* for scrollbar */
        justify-content: space-between;
    }

    .premium-search,
    .search-box {
        width: 100%;
        max-width: none;
    }

    .search-box input,
    .premium-search input {
        width: 100%;
    }

    .top-header .search-box {
        display: none;
        /* Hide global search on mobile to save space */
    }

    .header-right {
        gap: 12px;
    }

    .stats-row {
        grid-template-columns: 1fr;
        /* Stack stats vertically */
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 16px;
    }

    .purchase-items-table th,
    .purchase-items-table td {
        padding: 5px;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    /* Below sidebar (1000) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}