/* ============================================
   BODEGA NI TATAY - PROCUREMENT SYSTEM
   Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-white: #ffffff;
    --bg-dark: #1e293b;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;

    --transition: all 0.2s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-white);
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.role-selector {
    margin-bottom: 24px;
}

.role-selector label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.role-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.role-btn {
    padding: 12px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.role-btn i {
    font-size: 20px;
}

.role-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.role-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   APP LAYOUT
   ============================================ */
#app-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.brand i {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.notifications-dropdown {
    position: relative;
}

.notifications-panel {
    position: absolute;
    top: 50px;
    right: 0;
    width: 360px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 200;
}

.notifications-panel.active {
    display: block;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.notifications-header button {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: var(--primary-light);
}

.notification-item.unread:hover {
    background: #bfdbfe;
}

.notification-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.notification-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-btn:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-btn span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-btn i {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 240px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 200;
}

.user-menu.active {
    display: block;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.user-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.user-menu-item:hover {
    background: var(--bg-secondary);
}

.user-menu-item i {
    width: 20px;
    color: var(--text-secondary);
}

.user-menu-item.text-danger {
    color: var(--danger);
}

.user-menu-item.text-danger i {
    color: var(--danger);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    z-index: 90;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

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

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

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header h2 i {
    margin-right: 8px;
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

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

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

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

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

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

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

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

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

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

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

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

.badge-success .badge-dot {
    background: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-warning .badge-dot {
    background: var(--warning);
}

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

.badge-danger .badge-dot {
    background: var(--danger);
}

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

.badge-info .badge-dot {
    background: var(--info);
}

.badge-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-secondary .badge-dot {
    background: var(--text-secondary);
}

/* Stock Level Indicators */
.stock-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stock-bar-fill.high {
    background: var(--success);
}

.stock-bar-fill.medium {
    background: var(--warning);
}

.stock-bar-fill.low {
    background: var(--danger);
}

.stock-text {
    font-size: 13px;
    font-weight: 500;
}

.stock-text.high {
    color: var(--success);
}

.stock-text.medium {
    color: var(--warning);
}

.stock-text.low {
    color: var(--danger);
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

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

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--bg-white);
    cursor: pointer;
    min-width: 150px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot.completed {
    background: var(--success);
    border-color: var(--success);
}

.timeline-dot.completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    color: var(--text-white);
}

.timeline-dot.current {
    background: var(--primary);
    border-color: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}

.timeline-content {
    font-size: 14px;
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.timeline-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Daily Count Form */
.daily-count-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 80px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.daily-count-item:last-child {
    border-bottom: none;
}

.daily-count-item-name {
    font-size: 14px;
    font-weight: 500;
}

.daily-count-item-sku {
    font-size: 11px;
    color: var(--text-muted);
}

.daily-count-item input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
}

.daily-count-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.daily-count-status {
    text-align: center;
    font-size: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 310;
    display: none;
    opacity: 0;
    transition: all 0.2s ease;
}

.modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header h2 i {
    margin-right: 8px;
    color: var(--primary);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* PO Items in Modal */
.po-items-list {
    margin-bottom: 16px;
}

.po-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
}

.po-item-row-name {
    font-size: 13px;
    font-weight: 500;
}

.po-item-row-qty {
    font-size: 13px;
    color: var(--text-secondary);
}

.po-item-row-price {
    font-size: 13px;
    font-weight: 600;
}

.po-item-row-remove {
    color: var(--danger);
    cursor: pointer;
}

.po-item-search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.po-search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.po-search-result-item:hover {
    background: var(--bg-secondary);
}

.po-search-result-item:last-child {
    border-bottom: none;
}

.po-search-result-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.po-search-result-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.po-search-result-stock {
    text-align: right;
}

.po-search-result-stock .stock-label {
    font-size: 11px;
    color: var(--text-muted);
}

.po-search-result-stock .stock-value {
    font-size: 14px;
    font-weight: 600;
}

/* Approval PO Content */
.approval-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

.approval-item-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.approval-item-info .stock-info {
    font-size: 12px;
    color: var(--text-muted);
}

.approval-item-input {
    text-align: center;
}

.approval-item-input label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.approval-item-input input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    text-align: center;
}

/* Receive PO Content */
.receive-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    color: var(--text-muted);
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.alert-info {
    background: var(--info-light);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-danger {
    background: var(--danger-light);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-icon {
    font-size: 18px;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-text {
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 24px;
    color: var(--primary);
}

.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Charts placeholder */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .nav-item span {
        display: none;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

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

    .daily-count-item {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .daily-count-item-name {
        grid-column: 1 / -1;
    }
}

@media (max-width: 576px) {
    .app-header {
        padding: 0 12px;
    }

    .brand span {
        display: none;
    }

    .user-btn span {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .login-card {
        padding: 24px;
    }

    .role-buttons {
        grid-template-columns: 1fr;
    }

    .role-btn {
        flex-direction: row;
        justify-content: center;
    }

    .daily-count-item {
        grid-template-columns: 1fr 1fr;
    }

    .approval-item-row,
    .receive-item-row,
    .po-item-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Print styles */
@media print {
    .app-header,
    .sidebar,
    .page-header-actions,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        margin-top: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
