/* OPG ERP v2.0 - SaaS Stylings */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Header */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo-box {
    background: var(--primary);
    color: white;
    font-weight: 800;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.brand h1 { margin: 0; font-size: 1.1rem; letter-spacing: -0.025em; }
.brand small { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }

/* Main Shell */
.app-main {
    display: flex;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
}

@media (max-width: 1024px) { .sidebar { display: none; } }

.side-nav a {
    display: block;
    padding: 10px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.side-nav a:hover { background: #f1f5f9; color: var(--text-dark); }
.side-nav a.active { background: var(--mod-bg); color: var(--primary); }

.nav-group {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    margin: 1.5rem 0 0.5rem 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Content Area */
.content-area { flex: 1; padding: 2rem; }
@media (max-width: 640px) { .content-area { padding: 1rem; } }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card { text-align: left; }
.stat-card .label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--text-dark); margin-top: 4px; }

/* Tables */
.table-container { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f8fafc; padding: 12px 16px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.1s;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }

/* Sticky Actions */
.sticky-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 999;
}

/* Mobile Nav Bar */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    justify-content: space-around;
    padding: 12px;
    z-index: 1000;
}

@media (max-width: 1024px) { .mobile-nav { display: flex; } body { padding-bottom: 70px; } }

/* Badges */
.badge { padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; display: inline-block; }
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-ship { background: #fef3c7; color: #92400e; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}
input:focus { border-color: var(--primary); outline: none; }

/* Print */
@media print {
    .no-print { display: none !important; }
    .content-area { padding: 0; }
    .card { border: none; box-shadow: none; }
}

/* POS UI Optimization */
.pos-input {
    font-size: 2.5rem;
    height: 80px;
    text-align: center;
    font-weight: 800;
    background: #0f172a;
    color: #10b981;
    border: 2px solid #10b981;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1500;
}