/* StecuPay — Bright Blue v3 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --brand-from:    #3b82f6;
    --brand-to:      #2563eb;
    --brand-dark:    #1d4ed8;
    --brand-light:   #60a5fa;
    --brand-glow:    rgba(59,130,246,.35);
    --brand-glow-sm: rgba(59,130,246,.18);
    --blue-50:  #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe;
    --blue-400: #60a5fa; --blue-500: #3b82f6; --blue-600: #2563eb; --blue-700: #1d4ed8;
    --gray-50:  #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
    --gray-300: #cbd5e1; --gray-400: #94a3b8; --gray-500: #64748b;
    --gray-700: #334155; --gray-900: #0f172a; --white: #ffffff;
    --green: #10b981; --red: #ef4444; --orange: #f59e0b; --purple: #8b5cf6;
    --sidebar-w: 256px; --topbar-h: 64px;
    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 40px -4px rgba(0,0,0,.15);
    --glow-blue:    0 0 20px rgba(59,130,246,.3), 0 4px 12px rgba(59,130,246,.2);
    --glow-blue-lg: 0 0 40px rgba(59,130,246,.35), 0 8px 24px rgba(59,130,246,.25);
    --glow-green:   0 0 16px rgba(16,185,129,.3);
    --glow-red:     0 0 16px rgba(239,68,68,.3);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'SF Pro Display','SF Pro Text','Inter',-apple-system,BlinkMacSystemFont,sans-serif;
    background: var(--gray-50); color: var(--gray-900); -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }

.wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; z-index: 200;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-header { padding: 22px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.05); }
.brand-wrap { display: flex; align-items: center; gap: 11px; }
.brand-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
    border-radius: var(--r); display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; box-shadow: var(--glow-blue); flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 800; color: white; letter-spacing: -.3px; line-height: 1; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,.35); margin-top: 2px; }

.sidebar-nav { list-style: none; padding: 10px 10px; flex: 1; overflow-y: auto; }
.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--r-sm);
    color: rgba(255,255,255,.45); text-decoration: none;
    font-size: 13.5px; font-weight: 500; transition: all .15s;
}
.sidebar-nav a i { font-size: 15px; flex-shrink: 0; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
    color: white; box-shadow: var(--glow-blue);
}
.sidebar-group-label {
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,.2);
    text-transform: uppercase; letter-spacing: 1px; padding: 14px 12px 5px;
}
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.05); }
.user-card {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-radius: var(--r); background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
}
.user-avatar-wrap { position: relative; flex-shrink: 0; }
.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand-from));
    color: white; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-online {
    position: absolute; width: 8px; height: 8px;
    background: var(--green); border-radius: 50%;
    border: 1.5px solid #1e293b; bottom: -1px; right: -1px;
    box-shadow: var(--glow-green);
}
.user-name { font-size: 12.5px; font-weight: 600; color: white; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10.5px; color: rgba(255,255,255,.35); margin-top: 1px; }
.btn-logout {
    margin-left: auto; flex-shrink: 0; color: rgba(255,255,255,.3);
    text-decoration: none; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 14px; transition: all .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.18); color: #f87171; }

/* MAIN */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    height: var(--topbar-h); display: flex; align-items: center; padding: 0 28px;
    background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; gap: 14px;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 16px; font-weight: 700; color: var(--gray-900); letter-spacing: -.2px; }
.sidebar-toggle {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: var(--gray-500); width: 34px; height: 34px;
    display: none; align-items: center; justify-content: center;
    border-radius: var(--r-sm); transition: background .15s;
}
.sidebar-toggle:hover { background: var(--gray-100); }
.topbar-date {
    display: flex; align-items: center; gap: 6px; padding: 5px 12px;
    background: var(--blue-50); border: 1px solid var(--blue-100);
    border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--blue-600);
}
.topbar-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: var(--glow-green); }
.content-area { padding: 24px 28px; flex: 1; }

/* CARDS */
.card-box { background: var(--white); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }

/* STAT CARDS */
.stat-card {
    background: var(--white); border-radius: var(--r-lg); padding: 20px;
    border: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 14px;
    transition: all .2s ease; position: relative; overflow: hidden;
}
.stat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand-from), var(--brand-light));
    opacity: 0; transition: opacity .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md), 0 0 0 1px var(--blue-100); transform: translateY(-2px); }
.stat-card:hover::after { opacity: 1; }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-icon { width: 46px; height: 46px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.stat-icon.blue   { background: var(--blue-50);  color: var(--blue-600); box-shadow: 0 0 14px rgba(59,130,246,.15); }
.stat-icon.green  { background: #ecfdf5; color: var(--green);  box-shadow: 0 0 14px rgba(16,185,129,.15); }
.stat-icon.orange { background: #fffbeb; color: var(--orange); box-shadow: 0 0 14px rgba(245,158,11,.15); }
.stat-icon.purple { background: #f5f3ff; color: var(--purple); box-shadow: 0 0 14px rgba(139,92,246,.15); }
.stat-trend { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.stat-trend.up { background: #ecfdf5; color: var(--green); }
.stat-value { font-size: 24px; font-weight: 800; color: var(--gray-900); letter-spacing: -.5px; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--gray-500); font-weight: 500; margin-top: 3px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 7px; margin-bottom: 16px; }
.section-title i { color: var(--blue-500); }

/* TABLE */
.table { font-size: 13.5px; }
.table thead th { background: var(--gray-50); color: var(--gray-500); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--gray-200); padding: 11px 16px; white-space: nowrap; }
.table td { padding: 13px 16px; vertical-align: middle; border-bottom: 1px solid var(--gray-100); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--blue-50); }
.badge { font-weight: 600; font-size: 11px; padding: 4px 10px; border-radius: 99px; }
.product-thumb { width: 48px; height: 48px; border-radius: var(--r); object-fit: cover; border: 1px solid var(--gray-200); background: var(--gray-100); }

/* BUTTONS */
.btn { font-weight: 600; font-size: 13.5px; border-radius: var(--r-sm); transition: all .15s; }
.btn-primary { background: linear-gradient(135deg, var(--brand-from), var(--brand-to)); border: none; color: white; box-shadow: 0 2px 8px var(--brand-glow-sm); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-to), var(--brand-dark)); box-shadow: var(--glow-blue); transform: translateY(-1px); color: white; }
.btn-primary:active { transform: translateY(0); color: white; }
.btn-primary:focus  { box-shadow: 0 0 0 3px rgba(59,130,246,.25); color: white; }

/* LOGIN */
.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.login-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); opacity: .2; }
.login-orb.o1 { width: 500px; height: 500px; background: var(--brand-from); top: -150px; left: -100px; animation: orbFloat 8s ease-in-out infinite; }
.login-orb.o2 { width: 350px; height: 350px; background: var(--purple); bottom: -80px; right: -80px; animation: orbFloat 10s ease-in-out infinite reverse; }
.login-orb.o3 { width: 200px; height: 200px; background: var(--brand-light); top: 40%; left: 40%; animation: orbFloat 6s ease-in-out infinite 2s; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-20px) scale(1.05); } }
.login-container { width: 100%; max-width: 400px; padding: 20px; position: relative; z-index: 1; }
.login-card {
    background: rgba(255,255,255,.06); backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-xl);
    padding: 42px 38px;
    box-shadow: 0 24px 64px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
}
.login-logo {
    width: 62px; height: 62px;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
    border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: white; margin: 0 auto 18px; box-shadow: var(--glow-blue-lg);
}
.login-title    { text-align: center; font-size: 26px; font-weight: 800; color: white; letter-spacing: -.5px; }
.login-subtitle { text-align: center; color: rgba(255,255,255,.35); font-size: 13px; margin: 5px 0 28px; }
.login-card .form-label { color: rgba(255,255,255,.6); font-size: 12.5px; font-weight: 500; margin-bottom: 6px; }
.login-card .form-control, .login-card .input-group-text { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: white; font-size: 14px; border-radius: var(--r-sm); }
.login-card .form-control:focus { background: rgba(255,255,255,.1); border-color: var(--brand-from); box-shadow: 0 0 0 3px rgba(59,130,246,.25); color: white; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.2); }
.login-card .input-group-text { color: rgba(255,255,255,.35); border-right: none; }
.login-card .input-group .form-control { border-left: none; }
.login-card .btn-primary { padding: 12px; font-size: 14px; font-weight: 700; border-radius: var(--r); }
.login-hint { text-align: center; color: rgba(255,255,255,.2); font-size: 12px; margin-top: 16px; }
.login-hint strong { color: rgba(255,255,255,.4); }

/* POS */
.pos-container { display: grid; grid-template-columns: 1fr 375px; gap: 20px; height: calc(100vh - var(--topbar-h) - 48px); }
.pos-products { overflow-y: auto; }
.pos-search .input-group-text { background: var(--white); border-right: none; border: 1px solid var(--gray-200); border-radius: var(--r) 0 0 var(--r); color: var(--gray-400); }
.pos-search .form-control { border: 1px solid var(--gray-200); border-left: none; border-radius: 0 var(--r) var(--r) 0; padding: 10px 14px; font-size: 13.5px; }
.pos-search .form-control:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px,1fr)); gap: 11px; margin-top: 14px; }
.product-card {
    background: var(--white); border-radius: var(--r-lg); border: 1.5px solid var(--gray-200);
    padding: 14px 11px; text-align: center; cursor: pointer;
    transition: all .2s cubic-bezier(.4,0,.2,1); user-select: none;
}
.product-card:hover { border-color: var(--blue-400); box-shadow: var(--glow-blue), var(--shadow-md); transform: translateY(-3px); }
.product-card:active { transform: scale(.96); }
.product-card img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--r); margin-bottom: 9px; border: 1px solid var(--gray-100); }
.product-name  { font-size: 12.5px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; line-height: 1.3; }
.product-price { font-size: 12.5px; font-weight: 700; color: var(--blue-600); background: var(--blue-50); display: inline-block; padding: 2px 10px; border-radius: 99px; }

.pos-cart { background: var(--white); border-radius: var(--r-lg); border: 1px solid var(--gray-200); display: flex; flex-direction: column; overflow: hidden; }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--gray-100); background: var(--gray-50); }
.cart-header h5 { font-size: 14px; font-weight: 700; color: var(--gray-900); margin: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--gray-400); gap: 8px; padding: 40px 0; }
.cart-empty i { font-size: 36px; opacity: .3; }
.cart-empty p { font-size: 13px; }
.cart-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--r); background: var(--gray-50); margin-bottom: 7px; border: 1px solid var(--gray-100); transition: all .15s; }
.cart-item:hover { background: var(--blue-50); border-color: var(--blue-100); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name  { font-size: 12.5px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.cart-qty { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.cart-qty button { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--gray-200); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--gray-600); transition: all .15s; line-height: 1; }
.cart-qty button:hover { background: var(--blue-600); color: white; border-color: var(--blue-600); box-shadow: 0 0 10px rgba(37,99,235,.3); }
.cart-qty span { min-width: 20px; text-align: center; font-weight: 700; font-size: 13px; }
.cart-footer { padding: 16px 18px; border-top: 1px solid var(--gray-100); }
.price-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--gray-600); margin-bottom: 9px; }
.price-row.total { font-size: 20px; font-weight: 800; color: var(--gray-900); padding-top: 11px; border-top: 2px solid var(--gray-100); margin-bottom: 0; }
.price-row.discount { color: var(--red); }
.discount-section { margin: 10px 0; padding: 12px; background: var(--gray-50); border-radius: var(--r); border: 1px solid var(--gray-100); }
.discount-section .form-select, .discount-section .form-control { font-size: 12.5px; border-color: var(--gray-200); border-radius: var(--r-sm); }
.btn-pay {
    height: 50px; font-size: 15px; font-weight: 700; border-radius: var(--r); width: 100%; margin-top: 12px;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to)); border: none; color: white;
    box-shadow: var(--glow-blue); transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-pay:hover { box-shadow: var(--glow-blue-lg); transform: translateY(-1px); color: white; }
.btn-pay:active { transform: translateY(0); color: white; }
.btn-pay:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* PAY OVERLAY */
.pay-overlay { position: fixed; inset: 0; background: rgba(10,15,30,.92); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(12px); }
.pay-overlay-inner { text-align: center; color: white; max-width: 420px; width: 100%; padding: 40px 30px; }
.pay-card-anim {
    width: 110px; height: 70px;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-light));
    border-radius: 14px; margin: 0 auto 26px;
    display: flex; align-items: center; justify-content: center; font-size: 32px;
    animation: cardPulse 1.8s infinite; box-shadow: var(--glow-blue-lg);
    position: relative; overflow: hidden;
}
.pay-card-anim::before { content: ''; position: absolute; width: 50px; height: 34px; background: rgba(255,255,255,.15); border-radius: 5px; top: 10px; left: 12px; }
@keyframes cardPulse { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,.6),var(--glow-blue); } 70% { box-shadow: 0 0 0 22px rgba(59,130,246,0),var(--glow-blue); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0),var(--glow-blue); } }
.pay-title   { font-size: 22px; font-weight: 800; margin-bottom: 5px; }
.pay-amount  { font-size: 42px; font-weight: 900; letter-spacing: -1.5px; margin: 8px 0; background: linear-gradient(135deg, white, var(--blue-200)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.pay-subtitle { color: rgba(255,255,255,.4); font-size: 13.5px; }
.pay-dots { display: flex; justify-content: center; gap: 5px; margin: 18px 0; }
.pay-dot { width: 7px; height: 7px; background: var(--blue-400); border-radius: 50%; animation: dotBounce .8s infinite; }
.pay-dot:nth-child(2) { animation-delay: .15s; }
.pay-dot:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce { 0%,80%,100% { transform: scale(1); opacity: .4; } 40% { transform: scale(1.5); opacity: 1; } }
.pay-result-box { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-lg); padding: 22px; margin-top: 18px; animation: fadeUp .3s ease; }
.pay-result-box.success { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.08); box-shadow: 0 0 30px rgba(16,185,129,.1); }
.pay-result-box.error   { border-color: rgba(239,68,68,.3);  background: rgba(239,68,68,.08);  box-shadow: 0 0 30px rgba(239,68,68,.1); }
@keyframes fadeUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
.pay-result-icon  { font-size: 42px; margin-bottom: 8px; }
.pay-result-title { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.pay-result-info  { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.5; }
.btn-cancel { margin-top: 22px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.6); padding: 9px 26px; border-radius: 99px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-cancel:hover { background: rgba(255,255,255,.12); color: white; }
.rfid-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* SMART CARD */
.rfid-scan-card { background: var(--white); border-radius: var(--r-xl); padding: 32px 24px; border: 1px solid var(--gray-200); text-align: center; }
.rfid-icon-wrap { width: 82px; height: 82px; background: var(--blue-50); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 34px; color: var(--blue-600); animation: scanPulse 2s infinite; }
@keyframes scanPulse { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,.3); } 70% { box-shadow: 0 0 0 18px rgba(59,130,246,0); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }
.rfid-input { width: 100%; padding: 12px 16px; border: 2px solid var(--blue-200); border-radius: var(--r); font-size: 14px; background: var(--blue-50); text-align: center; color: var(--gray-700); font-weight: 500; outline: none; transition: all .2s; }
.rfid-input:focus { border-color: var(--blue-500); background: white; box-shadow: 0 0 0 4px rgba(59,130,246,.12), var(--glow-blue); }

.student-card { background: var(--white); border-radius: var(--r-xl); border: 1px solid var(--gray-200); overflow: hidden; }
.student-card-header {
    background: linear-gradient(135deg, var(--brand-to), var(--brand-from), var(--brand-light));
    padding: 22px; display: flex; align-items: center; gap: 14px;
}
.student-avatar { width: 56px; height: 56px; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.35); color: white; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; flex-shrink: 0; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.student-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-name { font-size: 17px; font-weight: 800; color: white; letter-spacing: -.2px; }
.student-nis  { font-size: 12.5px; color: rgba(255,255,255,.65); margin-top: 2px; }
.balance-block { margin: 0 22px; margin-top: -18px; background: white; border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-md), 0 0 20px rgba(59,130,246,.08); }
.balance-label  { font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.balance-amount { font-size: 26px; font-weight: 900; color: var(--gray-900); letter-spacing: -.5px; margin-top: 3px; }
.student-card-body { padding: 20px 22px; }
.tx-list { display: flex; flex-direction: column; gap: 7px; }
.tx-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r); background: var(--gray-50); border: 1px solid var(--gray-100); transition: all .15s; }
.tx-item:hover { background: var(--blue-50); border-color: var(--blue-100); box-shadow: 0 0 12px rgba(59,130,246,.08); }
.tx-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.tx-icon.up   { background: #ecfdf5; color: var(--green); box-shadow: 0 0 10px rgba(16,185,129,.15); }
.tx-icon.down { background: var(--blue-50); color: var(--blue-600); box-shadow: 0 0 10px rgba(59,130,246,.12); }
.tx-detail { flex: 1; }
.tx-type   { font-size: 12.5px; font-weight: 600; color: var(--gray-800); }
.tx-date   { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.tx-amount { font-weight: 700; font-size: 13.5px; }
.tx-amount.credit { color: var(--green); }
.tx-amount.debit  { color: var(--red); }

/* STUDENT RFID LIST */
.student-list-card { background: var(--white); border-radius: var(--r-xl); border: 1px solid var(--gray-200); overflow: hidden; }
.student-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--gray-100); transition: background .15s; }
.student-row:last-child { border-bottom: none; }
.student-row:hover { background: var(--blue-50); }
.student-row-avatar { width: 42px; height: 42px; border-radius: var(--r); object-fit: cover; border: 1px solid var(--gray-200); background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--blue-600); flex-shrink: 0; overflow: hidden; }
.student-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-row-info { flex: 1; min-width: 0; }
.student-row-name { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.student-row-nis  { font-size: 11.5px; color: var(--gray-500); margin-top: 1px; }
.rfid-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; font-family: monospace; letter-spacing: .3px; }
.rfid-tag.set     { background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--blue-100); box-shadow: 0 0 8px rgba(59,130,246,.1); }
.rfid-tag.not-set { background: var(--gray-100); color: var(--gray-400); border: 1px solid var(--gray-200); }

/* PHOTO PREVIEW */
.photo-preview-wrap { width: 80px; height: 80px; border-radius: var(--r); border: 2px dashed var(--gray-300); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--gray-50); color: var(--gray-400); font-size: 24px; cursor: pointer; transition: all .2s; flex-shrink: 0; }
.photo-preview-wrap:hover { border-color: var(--blue-400); color: var(--blue-500); background: var(--blue-50); box-shadow: 0 0 12px rgba(59,130,246,.15); }
.photo-preview-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* MODAL */
.modal-content { border-radius: var(--r-xl); border: 1px solid var(--gray-200); box-shadow: var(--shadow-xl); }
.modal-header { border-bottom: 1px solid var(--gray-100); padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--gray-100); padding: 14px 22px; }
.modal-title { font-weight: 700; font-size: 15px; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.quick-amount-btn { padding: 6px 13px; border: 1.5px solid var(--gray-200); background: var(--gray-50); border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--gray-700); transition: all .15s; }
.quick-amount-btn:hover { background: var(--blue-50); border-color: var(--blue-400); color: var(--blue-600); box-shadow: 0 0 10px rgba(59,130,246,.12); }
.alert { border-radius: var(--r); font-size: 13.5px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* FLEX UTILITIES FOR RESPONSIVE */
.flex-grow-1 { flex-grow: 1; }
.flex-sm-grow-0 { flex-grow: 0; }
@media (min-width: 576px) {
    .flex-sm-grow-0 { flex-grow: 0 !important; }
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .sidebar-nav a { font-size: 13px; gap: 8px; }
    .brand-name { font-size: 15px; }
    .topbar-date { font-size: 11px; }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex !important; }
    .pos-container { height: auto; gap: 16px; }
    .page-title { font-size: 15px; }
    .topbar { padding: 0 16px; }
    .content-area { padding: 16px; }
    .card-box { padding: 16px; }
    .table { font-size: 12px; }
    .table th { padding: 8px 12px; font-size: 10px; }
    .table td { padding: 10px 12px; }
    .btn { font-size: 12px; padding: 8px 12px; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0; --topbar-h: 56px; }
    
    /* Layout */
    .sidebar { z-index: 300; }
    .main-content { margin-left: 0; }
    .content-area { padding: 12px; }
    .page-title { font-size: 14px; }
    .topbar { padding: 0 12px; gap: 8px; }
    
    /* POS */
    .pos-container { 
        grid-template-columns: 1fr; 
        height: auto; 
        gap: 12px; 
        padding: 12px;
    }
    .pos-cart { max-height: 60vh; }
    .product-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    .product-card { padding: 10px 8px; }
    .product-card img { width: 60px; height: 60px; }
    .product-name { font-size: 11px; }
    .product-price { font-size: 11px; }
    
    /* Cards */
    .card-box { padding: 12px; border-radius: var(--r); }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }
    
    /* Tables */
    .table { font-size: 11.5px; }
    .table thead { display: none; }
    .table tbody tr { 
        display: block; 
        border: 1px solid var(--gray-200); 
        border-radius: var(--r); 
        margin-bottom: 12px;
        padding: 12px;
        background: var(--white);
    }
    .table td { 
        display: block;
        border: none;
        padding: 8px 0;
        text-align: left;
    }
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        font-size: 10px;
        color: var(--gray-500);
        margin-bottom: 4px;
    }
    
    /* Modal */
    .modal-dialog { margin: 12px; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }
    .modal-title { font-size: 14px; }
    
    /* Forms */
    .form-control, .form-select { 
        font-size: 16px;
        padding: 10px 12px;
        border-radius: var(--r-sm);
    }
    .form-label { font-size: 12px; margin-bottom: 6px; }
    
    /* Buttons */
    .btn { 
        font-size: 13px; 
        padding: 9px 14px;
        border-radius: var(--r-sm);
        min-height: 40px;
    }
    .btn-sm { 
        font-size: 11px; 
        padding: 7px 10px;
        min-height: 32px;
    }
    .btn-pay { height: 44px; font-size: 14px; }
    
    /* Forms & Filters */
    .form-control, .form-select { 
        font-size: 16px;
        padding: 10px 12px;
        border-radius: var(--r-sm);
    }
    .form-label { font-size: 12px; margin-bottom: 6px; }
    
    /* Buttons */
    .btn { 
        font-size: 13px; 
        padding: 9px 14px;
        border-radius: var(--r-sm);
        min-height: 40px;
    }
    .btn-sm { 
        font-size: 11px; 
        padding: 7px 10px;
        min-height: 32px;
    }
    .btn-pay { height: 44px; font-size: 14px; }
    
    /* Input Groups */
    .input-group { flex-wrap: wrap; }
    .input-group-text { font-size: 13px; padding: 8px 10px; }
    
    /* Student List */
    .student-row { 
        padding: 10px 12px; 
        flex-wrap: wrap;
    }
    .student-row-avatar { width: 38px; height: 38px; font-size: 14px; }
    .student-row-info { flex: 1; min-width: 150px; }
    .rfid-tag { font-size: 10px; padding: 2px 8px; }
    
    /* Sidebar when expanded */
    .sidebar.open {
        position: fixed;
        inset: 0 0 0 auto;
        right: auto;
        width: 260px;
    }
}

@media (max-width: 600px) {
    /* Core */
    .topbar { gap: 4px; }
    .topbar-left { gap: 8px; }
    .topbar-date { display: none; }
    .sidebar-toggle { width: 38px; height: 38px; font-size: 18px; }
    
    /* Grid columns */
    .row.g-3 > * { padding-right: calc(6px / 2); padding-left: calc(6px / 2); }
    .col-md-6 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-7, .col-lg-5 { flex: 0 0 100%; max-width: 100%; }
    
    /* Product Grid */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .product-card img { width: 50px; height: 50px; }
    .product-name { font-size: 10px; }
    .product-price { font-size: 10px; }
    
    /* Stat Cards */
    .stat-card { padding: 12px; gap: 10px; }
    .stat-value { font-size: 18px; }
    .stat-icon { width: 36px; height: 36px; font-size: 14px; }
    
    /* Forms */
    .form-control, .form-select { font-size: 16px !important; }
    
    /* Text sizing */
    .section-title { font-size: 13px; margin-bottom: 12px; }
    .page-title { font-size: 13px; }
    body { font-size: 14px; }
    
    /* Student card */
    .student-card-header { padding: 16px 14px; }
    .student-avatar { width: 48px; height: 48px; font-size: 18px; }
    .student-name { font-size: 15px; }
    
    /* Balance */
    .balance-block { padding: 12px 14px; }
    .balance-amount { font-size: 22px; }
    
    /* Modal adjustments */
    .modal-dialog { width: 95vw; margin: 8px auto; }
    .photo-preview-wrap { width: 70px; height: 70px; font-size: 20px; }
    
    /* RFID Input */
    .rfid-input { padding: 10px 12px; font-size: 14px; }
    
    /* Cart */
    .cart-item { padding: 8px 10px; }
    .cart-item-name { font-size: 11px; }
    .cart-item-price { font-size: 10px; }
    .cart-qty button { width: 22px; height: 22px; font-size: 12px; }
    
    /* Price display */
    .price-row { font-size: 12px; }
    .price-row.total { font-size: 18px; }
    
    /* Pay overlay */
    .pay-overlay-inner { padding: 30px 20px; }
    .pay-amount { font-size: 36px; }
    .pay-title { font-size: 18px; margin-bottom: 4px; }
}

@media (max-width: 480px) {
    /* Core */
    .topbar { gap: 2px; }
    .topbar-left { gap: 6px; }
    .page-title { font-size: 12px; }
    .content-area { padding: 10px; }
    
    /* Product Grid */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
    .product-card { padding: 8px 6px; }
    .product-card img { width: 45px; height: 45px; margin-bottom: 6px; }
    .product-card:active { transform: scale(.94); }
    
    /* Buttons */
    .btn { 
        font-size: 12px; 
        padding: 8px 10px;
        border-radius: 6px;
    }
    .btn-sm { padding: 6px 8px; font-size: 10px; }
    
    /* Forms */
    .form-control, .form-select { 
        font-size: 16px !important;
        padding: 9px 10px;
    }
    
    /* Card Spacing */
    .card-box { padding: 10px; }
    .stat-card { padding: 10px; }
    
    /* Text */
    body { font-size: 13px; }
    h5, .modal-title { font-size: 13px; }
    small { font-size: 11px; }
    
    /* Tables - Stack everything */
    .table td::before { font-size: 9px; }
    .table tbody tr { margin-bottom: 10px; }
    
    /* Modal */
    .modal-dialog { width: 98vw; }
    .modal-body { padding: 12px; }
    .modal-header { padding: 12px; }
    
    /* Input group */
    .input-group { gap: 4px; }
    .d-flex.gap-2 { gap: 6px !important; }
    .d-flex.gap-3 { gap: 8px !important; }
}

@media (max-width: 360px) {
    /* Ultra small screens */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
    .product-card { padding: 6px 4px; }
    .product-card img { width: 40px; height: 40px; }
    .product-name { font-size: 9px; line-height: 1.2; }
    .product-price { font-size: 9px; }
    
    .btn { font-size: 11px; padding: 7px 8px; }
    .btn-sm { font-size: 9px; padding: 5px 6px; }
    
    .page-title { font-size: 11px; }
    body { font-size: 12px; }
    
    .card-box { padding: 8px; }
    .stat-card { padding: 8px; gap: 8px; }
    .stat-value { font-size: 16px; }
    .stat-icon { width: 32px; height: 32px; font-size: 12px; }
}
