/* ============================================
   MODERN LULUS TISSUES DASHBOARD CSS
   Updated Design System with Modern UI/UX
   ============================================ */

:root {
    /* Brand Colors - Updated for modern look */
    --primary: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --accent: #F9A825;
    --accent-light: #FFC107;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #4CAF50;
    
    /* Neutral Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --surface: #ffffff;
    --surface-dark: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows - Modern depths */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ============================================
   HEADER & TOOLBAR - Modern Design
   ============================================ */

header.toolbar {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-light);
    position: sticky;
    top: 1rem;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.toolbar-logo:hover {
    transform: scale(1.05);
}

.toolbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BUTTONS - Modern Styles
   ============================================ */

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--secondary-light) 100%);
    color: white;
}

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

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* ============================================
   CARDS - Modern Glass Morphism
   ============================================ */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Report Cards Grid */
.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.report-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
}

.report-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.report-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.report-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.metric {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.5rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.change {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 600;
}

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

/* ============================================
   STAT CARDS (Shared Overview)
   ============================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    letter-spacing: 0.2px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.stat-card .stat-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.accent-green { border-top: 3px solid #2e7d32; }
.accent-blue { border-top: 3px solid #1976d2; }
.accent-orange { border-top: 3px solid #f57c00; }
.accent-purple { border-top: 3px solid #6c3483; }
.accent-teal { border-top: 3px solid #0097a7; }
.accent-red { border-top: 3px solid #c62828; }

   SECTIONS
   ============================================ */

.section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* ============================================
   FORMS & INPUTS - Modern Design
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-control, input[type="text"], input[type="email"], 
input[type="password"], input[type="number"], input[type="date"],
select, textarea, .search-box, .filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   TABLES - Modern Design
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-primary);
}

tbody td {
    padding: 1rem;
    color: var(--text-primary);
}

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

/* ============================================
   USER MENU - Modern Dropdown
   ============================================ */

.user-menu {
    position: relative;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.user-dropdown {
    position: absolute;
    top: 3.5rem;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 260px;
    padding: 1rem;
    display: none;
    z-index: 1000;
    border: 1px solid var(--border-light);
    animation: slideDown var(--transition);
}

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

.user-dropdown.show {
    display: block;
}

.user-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.user-info strong {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.user-role-badge {
    margin-top: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.user-role-badge span {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.dropdown-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(2px);
}

.dropdown-btn.logout-btn {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    margin-bottom: 0;
}

.dropdown-btn.logout-btn:hover {
    background: #c82333;
    border-color: #c82333;
}

/* ============================================
   TIME DISPLAY
   ============================================ */

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.time-icon {
    font-size: 1.125rem;
}

.time-text {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* ============================================
   NAVIGATION - Modern Tabs
   ============================================ */

.dashboard-nav {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-light);
}

.dashboard-nav a {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--transition);
    white-space: nowrap;
}

.dashboard-nav a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dashboard-nav a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

/* ============================================
   ACTIONS
   ============================================ */

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header.toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   LOADING & STATUS INDICATORS
   ============================================ */

.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================
   MODERN ANIMATIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn var(--transition-slow);
}

/* ============================================
   MODAL STYLES - Modern Overlays & Dialogs
   ============================================ */

/* Modal Overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

/* When a modal must float above others */
.modal.top {
    z-index: 11000;
}

/* Show modal when active */
.modal.show,
.modal[style*="display: flex"],
.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Modal Content Container */
.modal-content {
    background-color: var(--surface);
    margin: auto;
    padding: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-content .section-pad,
.modal-content #reportContent {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.report-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 12px; /* leave gap from list card */
}

.report-filters label {
    font-weight: 600;
    color: var(--text-secondary);
}

.report-filters input[type="search"],
.report-filters input[type="date"],
.report-filters select {
    min-width: 220px;
}

.filters-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-input {
    /* match filter-select look */
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9375rem;
    min-width: 340px;
}

.data-table a.branch-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}
.data-table a.branch-link:hover {
    text-decoration: underline;
}

/* Larger dialog variant */
.modal-content.large {
    max-width: 1100px;
    width: 95%;
}

/* Profile/detail modals: close button sticks at top, content scrolls */
#merchandiserProfileContent,
#shopProfileContent {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--surface) 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal Close Button */
.modal .close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.modal .close:hover,
.modal .close:focus {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* Form Groups in Modals */
.modal .form-group {
    margin-bottom: 1.5rem;
}

.modal .form-group:last-child {
    margin-bottom: 0;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.modal .form-group label small {
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

/* Form Controls in Modals */
.modal .form-control,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="number"],
.modal input[type="date"],
.modal input[type="time"],
.modal input[type="file"],
.modal input[type="password"],
.modal select,
.modal textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all var(--transition);
    background: var(--surface);
    color: var(--text-primary);
}

.modal .form-control:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Checkboxes in Modals */
.modal input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Photo Preview in Modal */
#photoPreview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    text-align: center;
}

#photoPreviewImg {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    object-fit: contain;
}

/* File Upload Styling */
.modal input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

.modal input[type="file"]::file-selector-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-right: 1rem;
}

.modal input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
}


