/* ============================================================
   Tophimal Cosmetics Pro — Stylesheet
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --pink: #ec4899; --pink-light: #fce7f3; --pink-dark: #be185d;
    --blue: #3b82f6; --blue-light: #eff6ff;
    --green: #22c55e; --green-dark: #16a34a;
    --amber: #f59e0b; --amber-light: #fef3c7;
    --purple: #8b5cf6; --indigo: #6366f1;
    --cyan: #06b6d4; --red: #ef4444;
    --gray: #6b7280; --gray-light: #f3f4f6;
    --text: #1e293b; --text-muted: #64748b;
    --border: #e2e8f0; --bg: #f1f5f9;
    --white: #ffffff;
    --radius: 10px; --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--pink); text-decoration: none; }

/* ---- LOGIN ---- */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #831843, #581c87); padding: 16px; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { background: var(--white); border-radius: 24px; padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 48px; color: var(--pink); }
.login-logo h2 { font-size: 22px; font-weight: 800; margin: 10px 0 4px; }
.login-logo p { color: var(--text-muted); font-size: 13px; }
.login-hint { margin-top: 16px; text-align: center; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 14px; }

/* ---- TOP NAV ---- */
.topnav { background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.topnav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.topnav-right { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.btn-logout { background: #fee2e2; color: #dc2626; border: none; padding: 6px 14px; border-radius: 20px; font-size: 12px; cursor: pointer; }
.btn-logout:hover { background: #fecaca; }

/* ---- TABS ---- */
.tabbar { background: var(--white); padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab-btn { padding: 11px 14px; border: none; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 5px; transition: .15s; }
.tab-btn.active { color: var(--pink-dark); border-bottom-color: var(--pink); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ---- PANELS ---- */
.main-content { max-width: 1300px; margin: 0 auto; padding: 20px 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- CARDS ---- */
.card { background: var(--white); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.card.mb-4 { margin-bottom: 16px; }
.card.mt-4 { margin-top: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.card-title { font-weight: 700; font-size: 15px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 768px) { .charts-grid { grid-template-columns: 1fr; } }

/* ---- METRICS ---- */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .metrics-grid { grid-template-columns: 1fr 1fr; } }
.metric-card { background: var(--white); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.metric-val { font-size: 20px; font-weight: 700; }
.border-green { border-left-color: #34d399; }
.border-blue { border-left-color: var(--blue); }
.border-amber { border-left-color: var(--amber); }
.border-purple { border-left-color: var(--purple); }
.border-pink { border-left-color: var(--pink); }
.border-cyan { border-left-color: var(--cyan); }
.border-indigo { border-left-color: var(--indigo); }
.border-red { border-left-color: var(--red); }
.progress-bar { height: 5px; background: var(--gray-light); border-radius: 10px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; transition: width .5s; }
.bg-indigo { background: var(--indigo); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.form-control { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 13px; color: var(--text); background: var(--white); transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236,72,153,.15); }
.form-control-sm { padding: 6px 10px; font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 10px; }

/* ---- BUTTONS ---- */
.btn { padding: 9px 18px; border: none; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary, .btn-pink { background: var(--pink); color: #fff; }
.btn-pink:hover { background: var(--pink-dark); }
.btn-green { background: var(--green-dark); color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-gray { background: var(--gray-light); color: var(--text); }
.btn-gray:hover { background: var(--border); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #dc2626; }
.btn-indigo { background: var(--indigo); color: #fff; }
.btn-indigo:hover { background: #4f46e5; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { background: var(--gray-light); padding: 8px 10px; text-align: left; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.badge-gray { background: var(--gray-light); color: var(--gray); }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-amber { background: var(--amber-light); color: #92400e; }
.badge-pink { background: var(--pink-light); color: var(--pink-dark); }

/* ---- CUSTOMER LAYOUT ---- */
.customer-search { padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.customer-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 400px; border-top: 1px solid var(--border); margin-top: 12px; }
@media (max-width: 700px) { .customer-layout { grid-template-columns: 1fr; } }
.customer-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 520px; }
.cust-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.cust-item:hover { background: var(--gray-light); }
.cust-item.active { background: var(--pink-light); border-left: 3px solid var(--pink); }
.cust-item-name { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; }
.cust-item-info { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; justify-content: space-between; }
.customer-detail { padding: 18px; overflow-y: auto; }
.cust-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.empty-state { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-muted); font-size: 14px; }

/* ---- SALE FORM ---- */
.sale-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.sale-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-weight: 600; }
.sales-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gift-form-grid { display: grid; grid-template-columns: 1fr 1fr 120px auto; gap: 10px; align-items: end; }
@media (max-width: 600px) { .gift-form-grid { grid-template-columns: 1fr 1fr; } }
.expense-form-grid { display: grid; grid-template-columns: 160px 140px 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 600px) { .expense-form-grid { grid-template-columns: 1fr 1fr; } }

/* ---- STAFF ---- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.staff-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 18px; }
.staff-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.staff-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.staff-stat { background: var(--gray-light); border-radius: 8px; padding: 10px; }
.staff-stat-label { font-size: 10px; color: var(--text-muted); }
.staff-stat-val { font-size: 16px; font-weight: 700; margin-top: 2px; }
.staff-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---- REPORT ---- */
.report-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.report-filters .active-filter { background: var(--pink); color: #fff; }
.report-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.report-stat { text-align: center; background: var(--gray-light); border-radius: var(--radius); padding: 16px; }
.ml-auto { margin-left: auto; }

/* ---- MODALS ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray); line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }
.highlight-box { background: var(--amber-light); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }

/* ---- TOAST ---- */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1e293b; color: #fff; padding: 11px 22px; border-radius: 30px; font-size: 13px; font-weight: 500; z-index: 9999; animation: slideIn .2s ease; box-shadow: var(--shadow-md); }
.toast.hidden { display: none; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- ALERTS ---- */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ---- COLORS ---- */
.text-pink { color: var(--pink); } .text-green { color: var(--green-dark); } .text-amber { color: var(--amber); }
.text-blue { color: var(--blue); } .text-purple { color: var(--purple); } .text-cyan { color: var(--cyan); }
.text-gray { color: var(--text-muted); } .text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.font-bold { font-weight: 700; } .mt-1 { margin-top: 4px; } .mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---- PRINT ---- */
@media print { .topnav, .tabbar, .modal-overlay, .toast, .no-print { display: none !important; }
  .tab-panel { display: block !important; } body { background: #fff; } }
