/* Modern Pharmacy POS System - Inspired by Hichiem.com */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - Blue Theme like Hichiem */
    --primary-blue: #0070F4;
    --primary-blue-light: #E5F1FE;
    --primary-blue-dark: #0056D2;

    /* Status Colors */
    --success-green: #10B981;
    --success-green-light: #D1FAE5;
    --warning-orange: #F59E0B;
    --warning-orange-light: #FEF3C7;
    --danger-red: #EF4444;
    --danger-red-light: #FEE2E2;
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;

    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Borders */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-900);
    text-decoration: none;
}

.logo svg {
    flex-shrink: 0;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: var(--spacing-xs);
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
}

.nav-link.active {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.search-box {
    position: relative;
    width: 320px;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.625rem var(--spacing-md) 0.625rem 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.notification-btn {
    position: relative;
    padding: var(--spacing-sm);
    border: none;
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: all 0.2s;
}

.notification-btn:hover {
    background: var(--gray-100);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-red);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-menu span {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

/* Main Container */
.main-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: var(--spacing-2xl);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.625rem var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 13px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card.blue .stat-icon {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.stat-card.green .stat-icon {
    background: var(--success-green-light);
    color: var(--success-green);
}

.stat-card.purple .stat-icon {
    background: var(--purple-light);
    color: var(--purple);
}

.stat-card.orange .stat-icon {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-green);
}

.stat-change.negative {
    color: var(--danger-red);
}

.stat-change.neutral {
    color: var(--gray-500);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-link {
    font-size: 14px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: var(--spacing-lg);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.search-input,
.filter-select,
.date-input {
    padding: 0.625rem var(--spacing-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    transition: all 0.2s;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.search-input:focus,
.filter-select:focus,
.date-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.filter-select {
    min-width: 180px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--spacing-lg);
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-blue);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    background: var(--gray-100);
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-xs);
}

.product-stock {
    font-size: 13px;
    color: var(--gray-500);
}

.product-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-700);
    margin-top: var(--spacing-sm);
}

/* Product Delete Button */
.product-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #DC2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.product-card:hover .product-delete-btn {
    opacity: 1;
}

.product-delete-btn:hover {
    background: #FEE2E2;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.product-delete-btn:active {
    transform: scale(0.95);
}

/* Suppliers Grid */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.supplier-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.supplier-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-blue);
}

.supplier-header {
    display: flex;
    align-items: start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.supplier-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-lg);
    background: var(--primary-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
}

.supplier-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
}

.supplier-id {
    font-size: 13px;
    color: var(--gray-500);
}

.supplier-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.supplier-detail {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--gray-600);
}

.supplier-detail svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

/* Table */
.table-container {
    overflow-x: auto;
    padding: var(--spacing-xl);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--gray-50);
}

th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-700);
}

tr:hover {
    background: var(--gray-50);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-green-light);
    color: var(--success-green);
}

.badge-warning {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
}

.badge-danger {
    background: var(--danger-red-light);
    color: var(--danger-red);
}

.badge-info {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: var(--spacing-xs);
}

.btn-view {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.btn-edit {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
}

.btn-delete {
    background: var(--danger-red-light);
    color: var(--danger-red);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 var(--spacing-lg);
    }

    .nav-menu {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: var(--spacing-lg);
    }

    .search-box {
        width: 200px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .suppliers-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: block;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* Expand Modal Button */
.expand-modal-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.expand-modal-btn:hover {
    background: var(--gray-200);
    color: var(--primary-blue);
}

.expand-modal-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Expanded Modal State */
.modal-content.expanded {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 95vh !important;
    max-height: 95vh !important;
    margin: 2.5vh auto !important;
}

.modal-content.expanded .modal-body {
    max-height: calc(95vh - 140px) !important;
}

.modal-content.expanded .wysiwyg-editor {
    min-height: 400px !important;
    max-height: 600px !important;
}

.modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-xl);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* Form Sections */
.form-section {
    margin-bottom: var(--spacing-xl);
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--primary-blue);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-family);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.form-group input:disabled,
.form-group select:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-group input[readonly] {
    background: var(--gray-50);
    color: var(--gray-600);
}

/* Import Items Table */
.import-items-container {
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background: var(--white);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.items-table thead {
    background: var(--gray-100);
}

.items-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.items-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

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

.items-table input,
.items-table select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-family);
}

.items-table input:focus,
.items-table select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--primary-blue-light);
}

/* ========================================
   Print Report Styles
   ======================================== */
@media print {
    body * {
        visibility: hidden;
    }

    #print-report-modal,
    #print-report-modal * {
        visibility: visible;
    }

    #print-report-modal {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: white;
    }

    #print-report-modal .modal-content {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    #print-report-modal .modal-header,
    #print-report-modal .modal-footer {
        display: none !important;
    }

    #print-report-content {
        padding: 1cm !important;
    }

    .report-page-break {
        page-break-after: always;
    }

    /* Ensure product images print properly */
    .report-table img {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        max-width: 50px;
        max-height: 50px;
    }
}

.report-container {
    font-family: 'Sarabun', Arial, sans-serif;
    line-height: 1.6;
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-800);
}

.report-header h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.report-header p {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0.25rem 0;
}

.report-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 14px;
}

.report-info-section {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
}

.report-info-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.report-info-section p {
    margin: 0.25rem 0;
    color: var(--gray-700);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 13px;
}

.report-table thead {
    background: var(--gray-800);
    color: white;
}

.report-table th,
.report-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--gray-300);
}

.report-table th {
    font-weight: 600;
    font-size: 13px;
}

.report-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.report-table .text-center {
    text-align: center;
}

.report-table .text-right {
    text-align: right;
}

.report-summary {
    margin-left: auto;
    width: 350px;
    margin-bottom: 2rem;
}

.report-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 14px;
}

.report-summary-row.total {
    background: var(--gray-800);
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin-top: 0.5rem;
}

.report-signature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.report-signature-box {
    text-align: center;
}

.report-signature-line {
    margin-top: 3rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-800);
}

.report-signature-label {
    font-size: 13px;
    color: var(--gray-700);
}

.items-table input:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.items-table .subtotal-display {
    font-weight: 600;
    color: var(--gray-900);
}

.btn-remove-item {
    background: transparent;
    border: none;
    color: var(--danger-red);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.btn-remove-item:hover {
    background: var(--danger-red-light);
}

.btn-add-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: auto;
}

/* Import Summary */
.import-summary {
    background: var(--primary-blue-light);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    font-size: 0.9375rem;
}

.summary-row.total {
    border-top: 2px solid var(--primary-blue);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-md);
    font-size: 1.125rem;
}

.summary-row strong {
    color: var(--primary-blue);
    font-weight: 600;
}

.summary-row.total strong {
    font-size: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Attribute Manager Result Messages */
.result {
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

.result.success {
    background: #D1FAE5;
    border: 1px solid #34D399;
    color: #065F46;
}

.result.error {
    background: #FEE2E2;
    border: 1px solid #F87171;
    color: #991B1B;
}

/* Table Action Buttons */
.btn-view {
    background: var(--primary-blue-light);
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.btn-view:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: var(--spacing-md);
    }

    .modal-content.modal-large {
        max-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .items-table {
        font-size: 0.8125rem;
    }

    .items-table th,
    .items-table td {
        padding: 0.5rem;
    }
}

/* Purchase Order Stock Indicators */
.stock-ok {
    color: var(--success-green);
    background-color: var(--success-green-light);
    font-weight: 600;
    text-align: center;
}

.stock-warning {
    color: var(--danger-red);
    background-color: var(--danger-red-light);
    font-weight: 600;
    text-align: center;
    animation: pulse 2s infinite;
}

/* Remaining After Order Column */
.remaining-after-order {
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.remaining-after-order:not(.stock-warning):not(.stock-ok) {
    color: var(--gray-700);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}


/* ===== WYSIWYG Editor Styles ===== */

/* Toolbar Button */
.toolbar-btn {
    background: white;
    border: 1px solid #DFE3E8;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #212B36;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #F4F6F8;
    border-color: #0070F4;
    color: #0070F4;
}

.toolbar-btn:active {
    background: #DFE3E8;
    transform: translateY(1px);
}

.toolbar-btn strong,
.toolbar-btn em,
.toolbar-btn u {
    pointer-events: none;
}

/* Toolbar Select Dropdown */
.toolbar-select {
    background: white;
    border: 1px solid #DFE3E8;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #212B36;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.toolbar-select:hover {
    border-color: #0070F4;
    background: #F4F6F8;
}

.toolbar-select:focus {
    border-color: #0070F4;
    box-shadow: 0 0 0 3px rgba(0, 112, 244, 0.1);
}

/* WYSIWYG Toolbar */
.wysiwyg-toolbar {
    user-select: none;
}

/* WYSIWYG Editor ContentEditable */
.wysiwyg-editor {
    outline: none;
}

.wysiwyg-editor:focus {
    border-color: #0070F4 !important;
    box-shadow: 0 0 0 3px rgba(0, 112, 244, 0.1);
}

/* WYSIWYG Editor - Format text inside */
.wysiwyg-editor h2 {
    font-size: 1.8em;
    font-weight: 700;
    margin: 16px 0 12px 0;
    color: #1F2937;
}

.wysiwyg-editor h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 14px 0 10px 0;
    color: #1F2937;
}

.wysiwyg-editor h4 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 12px 0 8px 0;
    color: #374151;
}

.wysiwyg-editor p {
    margin: 8px 0;
    line-height: 1.6;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol {
    margin: 12px 0;
    padding-left: 28px;
}

.wysiwyg-editor li {
    margin: 4px 0;
    line-height: 1.6;
}

.wysiwyg-editor blockquote {
    border-left: 4px solid #0070F4;
    background: #F9FAFB;
    padding: 12px 16px;
    margin: 12px 0;
    font-style: italic;
    color: #4B5563;
}

.wysiwyg-editor a {
    color: #0070F4;
    text-decoration: underline;
}

.wysiwyg-editor a:hover {
    color: #0056D2;
}

.wysiwyg-editor strong {
    font-weight: 700;
}

.wysiwyg-editor em {
    font-style: italic;
}

.wysiwyg-editor u {
    text-decoration: underline;
}

/* Hidden Textarea */
#blogContentEditor {
    resize: vertical;
    min-height: 300px;
}

#blogContentEditor:focus {
    outline: none;
    border-color: #0070F4;
    box-shadow: 0 0 0 3px rgba(0, 112, 244, 0.1);
}

