/* ===== QUEENCELL Multi-Branch Inventory Management System ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #6366f1;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 20px;
}

.login-container {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: #fff;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: 1rem;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
}

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

.login-info p {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.login-info small {
    display: block;
    color: var(--text-light);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

/* ===== Layout ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logo span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
}

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

.nav-badge {
    position: absolute;
    right: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* ===== Top Bar ===== */
.top-bar {
    background: var(--card-bg);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text);
    padding: 5px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.location-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
}

.location-selector i {
    color: var(--primary);
}

.location-selector select {
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 15px;
    gap: 10px;
    border: 1px solid var(--border);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    width: 200px;
    color: var(--text);
}

.search-box i {
    color: var(--text-light);
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ===== Page Content ===== */
.page-content {
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===== Section Title ===== */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.section-title i {
    color: var(--primary);
}

/* ===== Branch Overview ===== */
.branch-overview {
    margin-bottom: 25px;
}

.branch-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.branch-overview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

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

.branch-overview-card.hq { border-left-color: #8b5cf6; }
.branch-overview-card.kayonza { border-left-color: #3b82f6; }
.branch-overview-card.rusizi { border-left-color: #22c55e; }
.branch-overview-card.huye { border-left-color: #f59e0b; }
.branch-overview-card.nyabugogo { border-left-color: #db2777; }

.branch-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.branch-card-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.branch-card-icon.hq { background: #ede9fe; color: #8b5cf6; }
.branch-card-icon.kayonza { background: #dbeafe; color: #3b82f6; }
.branch-card-icon.rusizi { background: #dcfce7; color: #22c55e; }
.branch-card-icon.huye { background: #fef3c7; color: #f59e0b; }
.branch-card-icon.nyabugogo { background: #fce7f3; color: #db2777; }

.branch-card-title h4 {
    font-size: 1rem;
    font-weight: 600;
}

.branch-card-title span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.branch-card-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.branch-card-stat {
    text-align: center;
}

.branch-card-stat .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.branch-card-stat .label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== Cards ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.card-body {
    padding: 20px 25px;
}

/* ===== Dashboard Row ===== */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* ===== Brand Stats ===== */
.brand-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-count {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.progress-bar {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0;
}

/* ===== Activity List ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg);
}

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.activity-icon.sale { background: #dcfce7; color: #16a34a; }
.activity-icon.add { background: #dbeafe; color: #2563eb; }
.activity-icon.edit { background: #fef3c7; color: #d97706; }
.activity-icon.delete { background: #fee2e2; color: #dc2626; }
.activity-icon.transfer { background: #e0e7ff; color: #4f46e5; }
.activity-icon.receive { background: #d1fae5; color: #059669; }
.activity-icon.request { background: #fce7f3; color: #db2777; }
.activity-icon.po { background: #e0e7ff; color: #4f46e5; }

.activity-details {
    flex: 1;
}

.activity-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

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

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    background: var(--bg);
}

.data-table td {
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .empty-cell {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.in-stock { background: #dcfce7; color: #16a34a; }
.status-badge.low-stock { background: #fef3c7; color: #d97706; }
.status-badge.out-of-stock { background: #fee2e2; color: #dc2626; }
.status-badge.completed { background: #dcfce7; color: #16a34a; }
.status-badge.pending { background: #fef3c7; color: #d97706; }
.status-badge.approved { background: #dbeafe; color: #2563eb; }
.status-badge.received { background: #dcfce7; color: #16a34a; }
.status-badge.rejected { background: #fee2e2; color: #dc2626; }
.status-badge.cancelled { background: #f3f4f6; color: #6b7280; }
.status-badge.fulfilled { background: #dcfce7; color: #16a34a; }
.status-badge.urgent { background: #fee2e2; color: #dc2626; }
.status-badge.critical { background: #fecaca; color: #991b1b; }
.status-badge.normal { background: #e5e7eb; color: #374151; }

/* ===== Brand Tag ===== */
.brand-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text);
}

/* ===== Action Buttons ===== */
.action-btns {
    display: flex;
    gap: 5px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.85rem;
}

.action-btn.edit { background: #dbeafe; color: #2563eb; }
.action-btn.edit:hover { background: #2563eb; color: #fff; }
.action-btn.delete { background: #fee2e2; color: #dc2626; }
.action-btn.delete:hover { background: #dc2626; color: #fff; }
.action-btn.transfer { background: #e0e7ff; color: #4f46e5; }
.action-btn.transfer:hover { background: #4f46e5; color: #fff; }
.action-btn.approve { background: #dcfce7; color: #16a34a; }
.action-btn.approve:hover { background: #16a34a; color: #fff; }
.action-btn.reject { background: #fee2e2; color: #dc2626; }
.action-btn.reject:hover { background: #dc2626; color: #fff; }
.action-btn.receive { background: #d1fae5; color: #059669; }
.action-btn.receive:hover { background: #059669; color: #fff; }
.action-btn.view { background: #e0e7ff; color: #4f46e5; }
.action-btn.view:hover { background: #4f46e5; color: #fff; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ===== Forms ===== */
.product-form, .sale-form, .distribute-form {
    max-width: 900px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.form-section h4 i {
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fff;
    color: var(--text);
}

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

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-group.inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-group.inline input {
    width: 100px;
}

/* ===== Stock Info Box ===== */
.stock-info-box {
    background: var(--bg);
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.info-row span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.info-row strong {
    font-size: 1rem;
    color: var(--text);
}

/* ===== Filter Selects ===== */
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Sale Summary ===== */
.sale-summary, .po-summary {
    background: var(--bg);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.summary-row strong {
    font-size: 1.3rem;
    color: var(--primary);
}

/* ===== Purchase Order Items ===== */
.po-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.po-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
}

.po-item-row .form-group {
    margin-bottom: 0;
}

.po-item-row .form-group label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.po-item-row input[readonly] {
    background: #e2e8f0;
    font-weight: 600;
    color: var(--text);
}

/* ===== Branches Grid ===== */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.branch-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

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

.branch-card.hq-card {
    border-top-color: #8b5cf6;
    background: linear-gradient(135deg, #fff 0%, #f5f3ff 100%);
}

.branch-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.branch-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: #ede9fe;
    color: #8b5cf6;
}

.branch-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.branch-type {
    font-size: 0.8rem;
    color: var(--text-light);
}

.branch-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.branch-stat {
    text-align: center;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
}

.branch-stat .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-stat .stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}

.branch-footer {
    display: flex;
    gap: 10px;
}

/* ===== Settings ===== */
.settings-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.settings-section p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.danger-zone h4 {
    color: var(--danger);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

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

.toast i {
    font-size: 1.2rem;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1rem;
    padding: 0;
}

@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; }
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px 25px;
}

.modal-body p {
    color: var(--text-light);
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Request Details in Modal ===== */
.request-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.request-detail-row:last-child {
    border-bottom: none;
}

.request-detail-row .label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.request-detail-row .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .menu-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        display: block;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 12px 15px;
    }

    .page-content {
        padding: 15px;
    }

    .search-box {
        display: none;
    }

    .location-selector {
        display: none;
    }

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

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

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

    .header-actions {
        width: 100%;
    }

    .data-table {
        font-size: 0.8rem;
    }

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

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

    .po-item-row {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar-right .icon-btn {
        display: none;
    }

    .top-bar-right .notification-btn {
        display: block;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Print Styles ===== */
@media print {
    .sidebar, .top-bar, .action-btns, .btn {
        display: none;
    }

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

    .card {
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* ===== Cloud authentication ===== */
.auth-message {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}
.auth-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.auth-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.auth-message.info {
    display: block;
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}
.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 34px 0 26px;
    color: #64748b;
    font-size: 14px;
}
.auth-loading i {
    font-size: 28px;
    color: var(--primary);
}
.setup-intro {
    text-align: center;
    margin-bottom: 18px;
}
.setup-intro i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}
.setup-intro h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--text);
}
.setup-intro p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}
