/* VendorHub Ghana - Mobile-First Stylesheet */

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;

    /* Status Colors */
    --status-new: #3b82f6;
    --status-confirmed: #a855f7;
    --status-paid: #10b981;
    --status-delivery: #f59e0b;
    --status-delivered: #059669;
    --status-cancelled: #ef4444;
    --status-unpaid: #ef4444;
    --status-partial: #f59e0b;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark);
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: var(--space-md);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    margin-bottom: var(--space-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--light-gray);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-full);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark);
}

.form-group label small {
    font-weight: 400;
    color: var(--gray);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    transition: all 0.2s;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--gray);
}

.form-group-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--light-gray);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-new {
    background: #dbeafe;
    color: var(--status-new);
}

.badge-confirmed {
    background: #f3e8ff;
    color: var(--status-confirmed);
}

.badge-paid {
    background: #d1fae5;
    color: var(--status-paid);
}

.badge-delivery {
    background: #fef3c7;
    color: var(--status-delivery);
}

.badge-delivered {
    background: #d1fae5;
    color: var(--status-delivered);
}

.badge-cancelled {
    background: #fee2e2;
    color: var(--status-cancelled);
}

.badge-unpaid {
    background: #fee2e2;
    color: var(--status-unpaid);
}

.badge-partial {
    background: #fef3c7;
    color: var(--status-partial);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: var(--space-lg);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--gray);
    margin-bottom: 0;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: var(--gray);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-link {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem;
}

.navbar-link:hover {
    color: var(--primary);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    padding: var(--space-lg);
    overflow-y: auto;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: var(--space-sm);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem;
    color: var(--gray);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--light-gray);
    color: var(--primary);
}

/* Main Layout */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-lg);
    margin-left: 0;
    transition: margin-left 0.3s;
}

@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 260px;
    }
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.stat-card-icon {
    font-size: 2rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray);
    background: var(--light-gray);
}

tr:hover {
    background: var(--light-gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--gray);
    margin-bottom: var(--space-lg);
}

/* Sticky Action Bar (Mobile) */
.sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: var(--space-sm);
    z-index: 40;
}

@media (min-width: 768px) {
    .sticky-actions {
        position: static;
        border: none;
        padding: 0;
        box-shadow: none;
        margin-top: var(--space-lg);
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: white;
    color: var(--dark);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--space-sm);
}

.mt-2 {
    margin-top: var(--space-md);
}

.mt-3 {
    margin-top: var(--space-lg);
}

.mt-4 {
    margin-top: var(--space-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--space-sm);
}

.mb-2 {
    margin-bottom: var(--space-md);
}

.mb-3 {
    margin-bottom: var(--space-lg);
}

.mb-4 {
    margin-bottom: var(--space-xl);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: var(--space-sm);
}

.gap-2 {
    gap: var(--space-md);
}

.gap-3 {
    gap: var(--space-lg);
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none;
}

.block {
    display: block;
}

/* Modal Styles */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.cart-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    width: 90%;
    margin: 2rem auto;
}