:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --status-pending-bg: #fef3c7;
    --status-pending-color: #d97706;
    --status-approved-bg: #dcfce7;
    --status-approved-color: #15803d;
    --status-rejected-bg: #fee2e2;
    --status-rejected-color: #b91c1c;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: 70px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.top-header {
    background-color: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.company-badge {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Screens & Tabs */
.screen {
    padding: 16px;
    flex: 1;
}

.screen.hidden {
    display: none !important;
}

.tab-content {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Registration Form */
.registration-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.reg-header {
    text-align: center;
    margin-bottom: 24px;
}

.reg-icon {
    width: 60px;
    height: 60px;
    background: #dbeafe;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 12px;
}

.reg-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.reg-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Form inputs */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: #f8fafc;
    transition: border-color 0.2s, background-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
}

.tg-info-box {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    color: #0284c7;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.mt-3 {
    margin-top: 16px;
}

/* Status Pills Filter */
.filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e2e8f0;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

.pill-btn.active {
    background: var(--primary);
    color: #fff;
}

/* Products List & Cards */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    position: relative;
}

.product-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background-color: #f1f5f9;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.product-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
}

.product-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-status-badge.pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-color);
}

.product-status-badge.approved {
    background-color: var(--status-approved-bg);
    color: var(--status-approved-color);
}

.product-status-badge.rejected {
    background-color: var(--status-rejected-bg);
    color: var(--status-rejected-color);
}

.rejection-box {
    margin-top: 6px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #991b1b;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.stat-card.blue .stat-icon { color: #2563eb; }
.stat-card.green .stat-icon { color: #16a34a; }
.stat-card.orange .stat-icon { color: #ea580c; }

.stat-val {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Sales List */
.sales-list-container {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.sales-list-container h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.sales-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.sales-item-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.sales-item-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.sales-item-amount {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* Profile Card */
.profile-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 12px;
}

.profile-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.profile-company {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
    margin-bottom: 20px;
}

.profile-details-list {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.detail-icon {
    width: 34px;
    height: 34px;
    background: #fff;
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.detail-content {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 16px;
    border-radius: 8px;

}

.nav-btn i {
    font-size: 1.25rem;
}

.nav-btn.active {
    color: var(--primary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.modal-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.image-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
}

.image-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.image-preview img {
    max-height: 120px;
    border-radius: 8px;
    object-fit: contain;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
