/* === P Leathers Footwear – Dark Premium Theme === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:           #0b0f1a;
    --surface:      #131c2e;
    --surface-2:    #192236;
    --surface-3:    #1e2a3f;
    --border:       #1d2d45;
    --border-soft:  #243352;
    --text:         #dce6f5;
    --text-muted:   #7a8fa8;
    --text-faint:   #4a5c76;
    --accent:       #f0a500;
    --accent-hover: #d49300;
    --accent-glow:  rgba(240,165,0,.18);
    --success:      #10b981;
    --warning:      #f59e0b;
    --danger:       #ef4444;
    --info:         #3b82f6;
    --sidebar-w:    235px;
    --radius-sm:    8px;
    --radius:       12px;
    --radius-lg:    18px;
    --shadow-sm:    0 1px 6px rgba(0,0,0,.30);
    --shadow:       0 4px 22px rgba(0,0,0,.40);
    --shadow-lg:    0 12px 50px rgba(0,0,0,.60);
}

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

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
}

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #060a12 0%, #0a1524 55%, #060f1c 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(240,165,0,.09) 0%, transparent 70%);
    top: -150px; right: -150px;
    border-radius: 50%;
}

.login-box {
    background: var(--surface);
    border-radius: 22px;
    padding: 52px 44px;
    width: 400px;
    box-shadow: 0 28px 80px rgba(0,0,0,.7);
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
}

.login-box img { width: 88px; margin-bottom: 14px; border-radius: 12px; box-shadow: var(--shadow); }
.login-box h2 { color: var(--text); margin-bottom: 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.3px; }
.login-box p  { color: var(--text-muted); margin-bottom: 28px; font-size: 0.88rem; }

.form-group { margin-bottom: 18px; text-align: left; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.93rem; transition: border .2s, box-shadow .2s;
    outline: none; font-family: inherit;
    color: var(--text); background: var(--surface-2);
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface-3);
}
.form-group select option { background: var(--surface-2); color: var(--text); }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 0.86rem; font-weight: 600; text-decoration: none;
    transition: all .2s; font-family: inherit; letter-spacing: .2px;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--accent);      color: #0b0f1a; }
.btn-primary:hover  { background: var(--accent-hover); box-shadow: 0 4px 18px rgba(240,165,0,.40); }
.btn-success  { background: var(--success);     color: #fff; }
.btn-success:hover  { box-shadow: 0 4px 14px rgba(16,185,129,.35); }
.btn-warning  { background: var(--warning);     color: #0b0f1a; }
.btn-danger   { background: var(--danger);      color: #fff; }
.btn-danger:hover   { box-shadow: 0 4px 14px rgba(239,68,68,.35); }
.btn-gray     { background: var(--surface-2);   color: var(--text); border: 1.5px solid var(--border); }
.btn-gray:hover     { background: var(--surface-3); border-color: var(--border-soft); }
.btn-dark     { background: var(--surface-3);   color: var(--text); border: 1.5px solid var(--border-soft); }
.btn-dark:hover     { background: var(--border-soft); }
.btn-sm       { padding: 6px 14px; font-size: 0.79rem; }
.btn-full     { width: 100%; justify-content: center; }

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #060a14 0%, #0b1526 55%, #07101e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,.04);
    box-shadow: 4px 0 32px rgba(0,0,0,.55);
}

.sidebar-logo {
    padding: 24px 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-align: center;
}
.sidebar-logo-wrap {
    display: block;
    background: rgba(255,255,255,.97);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.5);
    text-align: center;
}
.sidebar-logo img { width: 150px; display: block; margin: 0 auto; border-radius: 4px; }

.sidebar nav {
    padding: 10px 0;
    flex: 1;
}
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 22px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: 0.87rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .2s;
    margin: 1px 0;
}
.sidebar nav a:hover {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.92);
    border-left-color: rgba(240,165,0,.5);
}
.sidebar nav a.active {
    background: rgba(240,165,0,.12);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar nav a.active .icon { color: var(--accent); }
.sidebar nav a .icon { font-size: 1.05rem; width: 22px; text-align: center; transition: color .2s; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: 0.80rem;
    color: rgba(255,255,255,.35);
}
.sidebar-footer > div:first-child { font-weight: 600; color: rgba(255,255,255,.85); font-size: 0.88rem; margin-bottom: 2px; }
.sidebar-footer > div:nth-child(2) {
    display: inline-block;
    background: rgba(240,165,0,.15);
    color: var(--accent);
    font-size: 0.70rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .6px;
    padding: 2px 9px; border-radius: 10px; margin-top: 3px;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 90;
}
.topbar h3 { color: var(--text); font-size: 1.02rem; font-weight: 700; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-badge {
    background: var(--surface-2);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 600;
    border: 1.5px solid var(--border);
}

.page { padding: 26px 28px; }

/* ---- CARDS / STAT ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.stat-card .value { font-size: 1.65rem; font-weight: 700; color: var(--text); letter-spacing: -.5px; }

/* ---- TABLE ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface-2);
}
.card-header h4 { color: var(--text); font-size: 0.92rem; font-weight: 700; letter-spacing: -.1px; }
.card-body { padding: 20px 22px; }

table { width: 100%; border-collapse: collapse; }
th {
    background: var(--surface-2);
    padding: 11px 14px;
    text-align: left;
    font-size: 0.71rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.89rem; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(240,165,0,.04); }

.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 0.74rem; font-weight: 600; letter-spacing: .15px;
}
.badge-success { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-danger  { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-warning { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-info    { background: rgba(59,130,246,.15);  color: #60a5fa; }

/* ---- POS ---- */
.pos-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; height: calc(100vh - 58px); padding: 16px; overflow: hidden; }
.pos-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: hidden; }
.pos-right { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.pos-search-row { display: flex; gap: 10px; }
.pos-search-row input, .pos-search-row select {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.93rem; outline: none; font-family: inherit;
    background: var(--surface-2); color: var(--text);
    transition: border .2s, box-shadow .2s;
}
.pos-search-row input:focus, .pos-search-row select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.pos-search-row select option { background: var(--surface-2); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding: 4px 4px 4px 0;
    align-content: start;
}
.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 195px;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.product-card .p-img {
    width: 100%; height: 105px;
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
}
.product-card .p-img-placeholder {
    width: 100%; height: 105px;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
}
.product-card .p-info { padding: 8px 10px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-card .p-name { font-weight: 600; font-size: 0.82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .p-brand { font-size: 0.72rem; color: var(--text-muted); }
.product-card .p-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.product-card .p-price { font-size: 0.95rem; font-weight: 700; color: var(--accent); }
.product-card .p-stock { font-size: 0.7rem; color: var(--text-muted); background: var(--surface-2); border-radius: 10px; padding: 2px 7px; }

/* Cart */
.cart-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cart-header h4 { color: var(--text); font-size: 0.95rem; font-weight: 700; }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 0; }
.cart-item { padding: 10px 18px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }
.cart-item-name { font-size: 0.87rem; font-weight: 600; color: var(--text); }
.cart-item-sub  { font-size: 0.76rem; color: var(--text-muted); }
.qty-ctrl { display: flex; align-items: center; gap: 6px; }
.qty-ctrl button { width: 26px; height: 26px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; cursor: pointer; font-weight: 700; transition: all .15s; }
.qty-ctrl button:hover { background: var(--accent); color: #0b0f1a; border-color: var(--accent); }
.qty-ctrl span { font-weight: 600; min-width: 20px; text-align: center; color: var(--text); }
.cart-item-total { font-weight: 700; color: var(--text); font-size: 0.9rem; }

.cart-footer { padding: 10px 14px; border-top: 1px solid var(--border); overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cart-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.90rem; color: var(--text); }
.cart-row.total { font-size: 1.08rem; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; }
.cart-row.balance { color: var(--success); font-weight: 700; }
/* POS cart form inputs inherit dark theme */
.cart-footer input, .cart-footer select {
    background: var(--surface-2); color: var(--text);
    border-color: var(--border) !important;
}
.cart-footer input::placeholder { color: var(--text-muted); }
.cart-footer label { color: var(--text-muted) !important; }
.cart-checkout .btn-primary { padding: 13px; width: 100%; }

/* ---- INVOICE ---- */
.invoice-wrap { max-width: 720px; margin: 0 auto; background: var(--surface); padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.invoice-head img { width: 70px; }
.invoice-head-right { text-align: right; }
.invoice-head-right h2 { color: var(--text); font-size: 1.4rem; }
.invoice-head-right p { font-size: 0.82rem; color: var(--text-muted); }
.invoice-title { text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 20px; letter-spacing: 2px; text-transform: uppercase; }
.invoice-meta { display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 0.88rem; color: var(--text); }
.invoice-meta div { line-height: 1.8; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.form-section-title { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin: 18px 0 10px; }

/* ---- STOCK SIZE TABLE ---- */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px,1fr)); gap: 10px; }
.size-cell { text-align: center; padding: 10px 6px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .15s; }
.size-cell:hover { border-color: var(--accent); }
.size-cell .sz-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.size-cell .sz-qty   { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ---- ALERTS ---- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.88rem; font-weight: 500; border-left: 4px solid; }
.alert-success { background: rgba(16,185,129,.12);  color: #34d399; border-color: var(--success); }
.alert-danger   { background: rgba(239,68,68,.12);   color: #f87171; border-color: var(--danger); }
.alert-warning  { background: rgba(245,158,11,.12);  color: #fbbf24; border-color: var(--warning); }

/* ---- MODAL ---- */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    width: 480px; max-width: 95vw; max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-soft);
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1)  translateY(0);    }
}
.modal-box h3 { color: var(--text); margin-bottom: 16px; font-size: 1.02rem; font-weight: 700; }
.modal-box .form-group { margin-bottom: 10px; }
.modal-box .form-group label { margin-bottom: 4px; font-size: 0.82rem; }
.modal-box .form-group input,
.modal-box .form-group select { padding: 8px 11px; font-size: 0.9rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    flex-wrap: wrap;
}
.pag-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-right: 8px;
    font-weight: 500;
}
.pag-btn {
    display: inline-block;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.81rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-2);
    transition: all .15s;
    font-weight: 500;
}
.pag-btn:hover { background: var(--surface-3); border-color: var(--border-soft); }
.pag-btn.active { background: var(--accent); color: #0b0f1a; border-color: var(--accent); font-weight: 700; box-shadow: 0 2px 10px rgba(240,165,0,.40); }

/* Print */
@media print {
    .no-print { display: none !important; }
    body { background: white; color: #111; }
    .main-content { margin-left: 0; }
    .invoice-wrap { box-shadow: none; padding: 0; background: white; border: none; color: #111; }
    .card { background: white; border: 1px solid #ddd; }
    th { background: #f0f0f0; color: #333; }
    td { color: #111; border-bottom: 1px solid #eee; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
