.fm-wrap { max-width: 1200px; margin: 20px 20px 40px 0; font-size: 14px; }
.fm-page-title { display:flex; align-items:center; gap:10px; font-size:24px; margin-bottom:20px; color:#1e293b; }
.fm-page-title .dashicons { font-size:26px; width:26px; height:26px; color:#2563eb; }

.fm-card { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:22px 24px; box-shadow:0 1px 2px rgba(0,0,0,0.04); margin-bottom:20px; }
.fm-card h2 { margin-top:0; font-size:16px; color:#1e293b; border-bottom:1px solid #f1f5f9; padding-bottom:10px; }
.fm-mt { margin-top: 20px; }

.fm-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.fm-grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:14px; }
@media (max-width: 900px) { .fm-grid-2, .fm-grid-4 { grid-template-columns:1fr; } }

.fm-wrap label { display:block; font-weight:600; margin:10px 0 4px; color:#334155; font-size:13px; }
.fm-wrap input[type=text], .fm-wrap input[type=number], .fm-wrap input[type=date], .fm-wrap input[type=password],
.fm-wrap select, .fm-wrap textarea {
	width:100%; padding:8px 10px; border:1px solid #cbd5e1; border-radius:6px; font-size:14px;
}
.fm-wrap input:focus, .fm-wrap select:focus, .fm-wrap textarea:focus { outline:none; border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,0.12); }

.fm-inline-row { display:flex; gap:14px; }
.fm-inline-row > div { flex:1; }

.fm-alert { padding:12px 16px; border-radius:8px; margin-bottom:16px; font-weight:500; }
.fm-alert-success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.fm-alert-error { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }

.fm-table { border-collapse:collapse; width:100%; }
.fm-table th, .fm-table td { padding:10px 12px; border-bottom:1px solid #f1f5f9; text-align:left; font-size:13px; }
.fm-table thead th { background:#f8fafc; color:#475569; font-weight:600; }
.fm-subtable { width:100%; }
.fm-subtable td { border:none; padding:3px 0; font-size:12px; }
.fm-qty-input { width:80px; display:inline-block; padding:4px 6px; }
.fm-inline-form { display:flex; align-items:center; gap:6px; }

.fm-badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; color:#fff; }
.fm-badge-sale { background:#2563eb; }
.fm-badge-qty { background:#d97706; }
.fm-badge-own { background:#16a34a; }
.fm-badge-outside { background:#dc2626; }

.fm-danger { color:#dc2626 !important; border-color:#fecaca !important; }

.fm-type-toggle { display:flex; gap:20px; background:#f8fafc; padding:14px 18px; border-radius:8px; margin-bottom:20px; }
.fm-toggle-option { display:flex; align-items:center; gap:8px; font-weight:600; cursor:pointer; }
.fm-toggle-option input { width:auto; }

.fm-suggestions { position:relative; }
.fm-suggestions-list { position:absolute; z-index:99; background:#fff; border:1px solid #cbd5e1; border-radius:6px; width:100%; max-height:220px; overflow-y:auto; box-shadow:0 6px 20px rgba(0,0,0,0.08); }
.fm-suggestions-list div { padding:8px 12px; cursor:pointer; font-size:13px; border-bottom:1px solid #f1f5f9; }
.fm-suggestions-list div:hover { background:#eff6ff; }

.fm-form-footer { margin-top:20px; padding-top:16px; border-top:1px solid #f1f5f9; }

.fm-stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:10px; }
@media (max-width: 1000px) { .fm-stat-grid { grid-template-columns:repeat(2,1fr); } }
.fm-stat-card { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:18px 20px; display:flex; align-items:center; gap:14px; }
.fm-stat-card .dashicons { font-size:32px; width:32px; height:32px; color:#2563eb; }
.fm-stat-card h3 { margin:0; font-size:22px; color:#1e293b; }
.fm-stat-card p { margin:2px 0 0; color:#64748b; font-size:13px; }

.fm-quick-actions { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; margin-bottom:20px; }
.fm-quick-action-btn {
	display:flex; flex-direction:column; align-items:center; gap:8px;
	background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:16px 10px;
	text-decoration:none; color:#1e293b; font-size:12.5px; font-weight:600; text-align:center;
	transition:.15s;
}
.fm-quick-action-btn:hover { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; transform:translateY(-1px); box-shadow:0 4px 12px rgba(37,99,235,.12); }
.fm-quick-action-btn .dashicons { font-size:24px; width:24px; height:24px; color:#2563eb; }

.fm-quick-actions { display:flex; flex-wrap:wrap; gap:10px; }

.fm-search-form { display:flex; gap:10px; margin-bottom:6px; }
.fm-search-form input { flex:1; padding:9px 12px; border:1px solid #cbd5e1; border-radius:6px; }

.fm-view-header { display:flex; justify-content:space-between; align-items:center; }

.fm-pin-gate { display:flex; justify-content:center; align-items:center; min-height:60vh; }
.fm-pin-card { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:40px; text-align:center; max-width:360px; box-shadow:0 4px 20px rgba(0,0,0,0.06); }
.fm-pin-card .dashicons { font-size:40px; width:40px; height:40px; color:#2563eb; }
.fm-pin-input { text-align:center; font-size:20px; letter-spacing:4px; margin:16px 0; }

.fm-price-col { white-space:nowrap; }

.mono { font-family:'Courier New', Consolas, monospace; font-size:.95em; }
.hint { font-size:11.5px; color:#64748b; background:#f8fafc; padding:8px 12px; border-radius:6px; margin-top:8px; display:block; }

/* Quick Add Product modal */
.fm-modal-overlay { position:fixed; inset:0; background:rgba(15,23,42,0.55); z-index:9999; display:flex; align-items:center; justify-content:center; padding:20px; }
.fm-modal-box { background:#fff; border-radius:12px; padding:26px 28px; max-width:440px; width:100%; max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.fm-modal-box h2 { margin:0 0 14px; font-size:17px; color:#1e293b; }
.fm-modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; padding-top:14px; border-top:1px solid #f1f5f9; }
.fm-quick-add-btn { margin-top:6px; width:100%; }

/* Client selector (challan forms) */
.fm-client-selector-wrap { background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:18px 20px; margin-bottom:18px; }
.fm-client-selector-row { display:flex; align-items:flex-end; gap:12px; }
.fm-suggestions-list { background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.1); overflow:hidden; margin-top:4px; }
.fm-suggestion-item { padding:10px 14px; cursor:pointer; font-size:13px; border-bottom:1px solid #f1f5f9; }
.fm-suggestion-item:last-child { border-bottom:none; }
.fm-suggestion-item:hover { background:#f1f5f9; }
.fm-sug-co { color:#64748b; font-size:12px; }
.fm-sug-mob { color:#2563eb; font-size:12px; margin-left:8px; font-family:'Courier New',monospace; }
.fm-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media (max-width:700px) { .fm-grid-3 { grid-template-columns:1fr; } }

/* Payment Mode Bar (New Cash Sale form) */
.fm-payment-mode-bar { display:flex; align-items:center; gap:10px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:14px 18px; margin-bottom:18px; flex-wrap:wrap; }
.fm-pm-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#64748b; margin-right:6px; }
.fm-pm-option { display:flex; align-items:center; gap:7px; cursor:pointer; padding:8px 16px; border-radius:8px; border:2px solid #e2e8f0; background:#fff; font-size:13.5px; font-weight:500; transition:.15s; }
.fm-pm-option input { display:none; }
.fm-pm-option:has(input:checked) { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; font-weight:700; }
.fm-pm-cash:has(input:checked) { border-color:#16a34a; background:#f0fdf4; color:#15803d; }
.fm-pm-gpay:has(input:checked) { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; }
.fm-pm-credit:has(input:checked) { border-color:#dc2626; background:#fff5f5; color:#dc2626; }

/* Staff attribution tag (Cash Sales, Regular Challans, Inward lists) */
.fm-staff-tag { display:inline-block; background:#f1f5f9; color:#475569; padding:2px 9px; border-radius:10px; font-size:11px; font-weight:600; }

/* UPI QR Code box (New Cash Sale form - GPay/Online payment) */
.fm-upi-qr-box { display:flex; align-items:center; gap:16px; background:#f0fdf4; border:1.5px solid #86efac; border-radius:10px; padding:14px 18px; margin-bottom:18px; }
.fm-upi-qr-box img { width:110px; height:110px; border-radius:8px; background:#fff; padding:6px; border:1px solid #e2e8f0; }
.fm-upi-qr-title { margin:0 0 2px; font-weight:700; font-size:14px; color:#166534; }
.fm-upi-qr-amount { margin:0 0 4px; font-size:15px; color:#1e293b; }
.fm-upi-qr-hint { margin:0; font-size:11.5px; color:#64748b; }
.fm-upi-qr-missing { margin:0; font-size:13px; color:#92400e; }

/* Shareable public PDF link row (challan detail views) */
.fm-share-link-row { display:flex; align-items:center; gap:8px; margin:14px 0 2px; }
.fm-share-link-row .dashicons { color:#64748b; font-size:16px; }
.fm-share-link-row input { flex:1; padding:7px 10px; border:1px solid #e2e8f0; border-radius:6px; font-size:12px; font-family:'Courier New',monospace; background:#f8fafc; color:#475569; }
.fm-share-link-row #fm-copy-link-msg { font-size:12px; font-weight:600; min-width:60px; }
.fm-share-link-hint { font-size:11.5px; color:#94a3b8; margin:0 0 16px; }

/* ============================================================
   PAGE HEADER (shared)
   ============================================================ */
.fm-page-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; }
.fm-page-sub { color:#64748b; font-size:13px; margin:-8px 0 0; }
.fm-header-stats { display:flex; gap:12px; }
.fm-hstat { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:10px 18px; text-align:center; min-width:80px; }
.fm-hstat-num { display:block; font-size:22px; font-weight:800; color:#1e293b; line-height:1.1; }
.fm-hstat-lbl { display:block; font-size:11px; color:#64748b; margin-top:2px; }

/* ============================================================
   CLIENTS PAGE
   ============================================================ */
.fm-search-card { padding:14px 18px !important; margin-bottom:0 !important; border-radius:10px 10px 0 0 !important; border-bottom:none !important; }
.fm-card-zero-top { border-radius:0 0 10px 10px !important; }
.fm-search-row { display:flex; gap:10px; align-items:center; }
.fm-search-icon-wrap { position:relative; flex:1; }
.fm-search-icon-wrap .dashicons { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:#94a3b8; font-size:18px; pointer-events:none; }
.fm-search-big { width:100%; padding:9px 12px 9px 36px !important; font-size:14px; }
.fm-btn-search { height:38px; }
.fm-btn-clear { height:38px; color:#64748b !important; }

.fm-clients-table thead th { background:#f8fafc; font-size:12px; text-transform:uppercase; letter-spacing:.5px; color:#64748b; font-weight:700; padding:10px 14px; }
.fm-client-row:hover { background:#f8fafc; }
.fm-row-num { color:#94a3b8; font-size:12px; text-align:center; width:30px; }
.fm-gstin-badge { font-size:11px; color:#7c3aed; background:#f5f3ff; padding:2px 6px; border-radius:4px; font-family:'Courier New',monospace; }
.fm-count-badge { display:inline-block; min-width:28px; text-align:center; padding:3px 8px; border-radius:20px; font-size:12px; font-weight:700; }
.fm-count-cash { background:#dbeafe; color:#1d4ed8; }
.fm-count-reg  { background:#dcfce7; color:#166534; }
.fm-none-dash  { color:#cbd5e1; }

/* Inline edit row */
.fm-edit-inline-row td { padding:0 !important; background:#fffbeb; border-bottom:2px solid #fcd34d !important; }
.fm-inline-edit-box { padding:16px 20px; }
.fm-inline-edit-box h3 { margin:0 0 12px; font-size:14px; color:#92400e; display:flex; align-items:center; gap:6px; }
.fm-grid-5-col { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
@media(max-width:1100px){ .fm-grid-5-col { grid-template-columns:repeat(3,1fr); } }
@media(max-width:700px) { .fm-grid-5-col { grid-template-columns:1fr; } }
.fm-edit-actions { display:flex; gap:10px; margin-top:12px; padding-top:10px; border-top:1px solid #fcd34d; }

/* Action icon buttons */
.fm-btn-icon { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px;
	border-radius:6px; border:1px solid transparent; cursor:pointer; transition:.15s; text-decoration:none; }
.fm-btn-edit   { border-color:#bfdbfe; background:#eff6ff; color:#2563eb !important; }
.fm-btn-edit:hover { background:#dbeafe; }
.fm-btn-delete { border-color:#fecaca; background:#fff5f5; color:#dc2626 !important; }
.fm-btn-delete:hover { background:#fee2e2; }
.fm-btn-save   { border-color:#bbf7d0; background:#f0fdf4; color:#16a34a !important; }
.fm-btn-save:hover { background:#dcfce7; }
.fm-btn-cancel-edit { border-color:#e2e8f0; background:#f8fafc; color:#64748b !important; }
.fm-btn-icon .dashicons { font-size:15px; width:15px; height:15px; }

.fm-empty-state { text-align:center; padding:48px 24px; color:#94a3b8; }
.fm-empty-state p { margin:12px 0 0; font-size:14px; }

/* ============================================================
   PRODUCT ATTRIBUTES PAGE — redesign
   ============================================================ */
.fm-attr-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media(max-width:1200px){ .fm-attr-grid { grid-template-columns:repeat(2,1fr); } }
@media(max-width:700px) { .fm-attr-grid { grid-template-columns:1fr; } }

.fm-attr-card { background:#fff; border:1px solid #e2e8f0; border-radius:12px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.05); }

.fm-attr-card-header { display:flex; align-items:center; gap:10px; padding:14px 16px;
	background:linear-gradient(135deg,#f8fafc,#f1f5f9); border-bottom:1px solid #e2e8f0; }
.fm-attr-card-header .dashicons { font-size:20px; width:20px; height:20px; color:#2563eb; flex-shrink:0; }
.fm-attr-card-header h2 { margin:0; font-size:14px; font-weight:700; color:#1e293b; }
.fm-attr-count { font-size:11px; color:#64748b; background:#e2e8f0; padding:1px 7px; border-radius:10px; margin-left:6px; }

/* Add form */
.fm-attr-add-form { padding:10px 14px; background:#fafbfc; border-bottom:1px solid #f1f5f9; }
.fm-attr-add-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.fm-attr-input { flex:1; min-width:120px; padding:7px 10px !important; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; }
.fm-attr-input:focus { border-color:#2563eb; outline:none; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.fm-attr-select-sm { padding:7px 6px !important; border:1px solid #cbd5e1; border-radius:6px; font-size:12px; background:#fff; max-width:130px; }
.fm-attr-add-btn { display:inline-flex; align-items:center; gap:4px; padding:7px 12px; background:#2563eb; color:#fff;
	border:none; border-radius:6px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
.fm-attr-add-btn:hover { background:#1d4ed8; }
.fm-attr-add-btn .dashicons { font-size:13px; width:13px; height:13px; }

/* List */
.fm-attr-list { max-height:320px; overflow-y:auto; }
.fm-attr-item { display:flex; align-items:center; gap:6px; padding:9px 14px;
	border-bottom:1px solid #f8fafc; transition:background .12s; flex-wrap:wrap; }
.fm-attr-item:last-child { border-bottom:none; }
.fm-attr-item:hover { background:#f8fafc; }
.fm-attr-editing { background:#fffbeb !important; border-bottom:2px solid #fcd34d !important; }

.fm-attr-val { font-size:13px; font-weight:600; color:#1e293b; flex:1; min-width:80px; }

.fm-attr-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 7px; border-radius:10px; }
.fm-attr-badge-blue   { background:#dbeafe; color:#1d4ed8; }
.fm-attr-badge-green  { background:#dcfce7; color:#166534; }
.fm-attr-badge-purple { background:#f3e8ff; color:#7c3aed; }
.fm-attr-badge-orange { background:#ffedd5; color:#c2410c; }

.fm-attr-actions { display:flex; gap:4px; margin-left:auto; }

/* Inline edit inside list */
.fm-attr-edit-form { display:flex; align-items:center; gap:6px; flex:1; flex-wrap:wrap; }
.fm-attr-edit-input { flex:1; min-width:100px; padding:5px 8px !important; border:1.5px solid #2563eb !important;
	border-radius:6px; font-size:13px; font-weight:600; }

.fm-attr-empty { text-align:center; padding:18px; color:#94a3b8; font-size:13px; }

/* Alert warning color */
.fm-alert-warning { background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }

/* ============================================================
   IMPORT / EXPORT CARDS
   ============================================================ */
.fm-impexp-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:0; }
@media(max-width:1000px){ .fm-impexp-grid { grid-template-columns:1fr 1fr; } }
@media(max-width:640px) { .fm-impexp-grid { grid-template-columns:1fr; } }

.fm-impexp-card { display:flex; flex-direction:column; gap:0; padding:0 !important; overflow:hidden; margin-bottom:0 !important; }

.fm-impexp-icon { display:flex; align-items:center; justify-content:center; padding:18px 0 14px; }
.fm-impexp-icon .dashicons { font-size:36px; width:36px; height:36px; }
.fm-impexp-icon-export { background:linear-gradient(135deg,#eff6ff,#dbeafe); }
.fm-impexp-icon-export .dashicons { color:#2563eb; }
.fm-impexp-icon-import { background:linear-gradient(135deg,#f0fdf4,#dcfce7); }
.fm-impexp-icon-import .dashicons { color:#16a34a; }
.fm-impexp-icon-sample { background:linear-gradient(135deg,#fefce8,#fef9c3); }
.fm-impexp-icon-sample .dashicons { color:#ca8a04; }

.fm-impexp-body { padding:14px 18px; flex:1; }
.fm-impexp-body h3 { margin:0 0 6px; font-size:15px; font-weight:700; color:#1e293b; }
.fm-impexp-body p  { margin:0 0 12px; font-size:13px; color:#64748b; line-height:1.5; }

.fm-impexp-btn { display:inline-flex !important; align-items:center; gap:6px; font-weight:600 !important; }
.fm-impexp-btn .dashicons { font-size:14px; width:14px; height:14px; }

.fm-impexp-format { padding:10px 18px 14px; font-size:11.5px; color:#64748b;
	border-top:1px solid #f1f5f9; background:#fafbfc; line-height:1.6; }
.fm-impexp-format code { background:#e2e8f0; padding:2px 6px; border-radius:4px;
	font-family:'Courier New',monospace; font-size:11px; color:#1e293b; }

/* File picker row */
.fm-import-form { margin:0; }
.fm-file-pick-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.fm-file-label { display:inline-flex; align-items:center; gap:6px; padding:7px 12px;
	border:1.5px dashed #cbd5e1; border-radius:6px; background:#f8fafc;
	cursor:pointer; font-size:13px; color:#64748b; flex:1; min-width:0;
	white-space:nowrap; overflow:hidden; text-overflow:ellipsis; transition:.15s; }
.fm-file-label:hover { border-color:#2563eb; background:#eff6ff; color:#2563eb; }
.fm-file-label .dashicons { font-size:16px; width:16px; height:16px; flex-shrink:0; }
input[type=file]#fm-csv-file { display:none; }

/* Table meta row */
.fm-table-meta { padding:10px 0 8px; font-size:12px; color:#64748b; }

.fm-sample-card { border:1px dashed #fcd34d !important; }

/* ============================================================
   SECURITY PAGE
   ============================================================ */
.fm-security-card { padding:0 !important; overflow:hidden; margin-bottom:20px; }

.fm-security-card-header { display:flex; align-items:center; gap:14px; padding:16px 22px;
	border-bottom:1px solid #f1f5f9; }
.fm-security-card-header .dashicons { font-size:28px; width:28px; height:28px; flex-shrink:0; }
.fm-security-card-header h2 { margin:0 0 2px; font-size:15px; font-weight:700; color:#1e293b; border:none; padding:0; }
.fm-security-card-header p  { margin:0; font-size:12px; color:#64748b; }
.fm-security-card-header > div { flex:1; }

.fm-sch-url  { background:linear-gradient(135deg,#f0f9ff,#e0f2fe); }
.fm-sch-url  .dashicons { color:#0284c7; }
.fm-sch-pin  { background:linear-gradient(135deg,#fdf4ff,#f3e8ff); }
.fm-sch-pin  .dashicons { color:#9333ea; }
.fm-sch-ip   { background:linear-gradient(135deg,#f0fdf4,#dcfce7); }
.fm-sch-ip   .dashicons { color:#16a34a; }

.fm-sec-status { display:inline-block; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:700; white-space:nowrap; }
.fm-sec-on  { background:#dcfce7; color:#166534; }
.fm-sec-off { background:#fef3c7; color:#92400e; }

.fm-sec-form { padding:16px 22px 4px; }

/* Current URL display */
.fm-sec-current-url { display:flex; align-items:center; gap:8px; padding:10px 22px;
	background:#f0fdf4; border-bottom:1px solid #dcfce7; flex-wrap:wrap; font-size:13px; }
.fm-login-url-link { color:#2563eb; font-weight:600; font-family:'Courier New',monospace;
	text-decoration:none; }
.fm-login-url-link:hover { text-decoration:underline; }
.fm-copy-btn { padding:3px 10px; border:1px solid #cbd5e1; border-radius:4px; background:#fff;
	cursor:pointer; font-size:11px; font-weight:600; color:#475569; }
.fm-copy-btn:hover { background:#f1f5f9; }

.fm-sec-blocked-urls { display:flex; align-items:center; gap:6px; padding:8px 22px;
	background:#fff5f5; border-bottom:1px solid #fecaca; font-size:12px; color:#64748b; flex-wrap:wrap; }
.fm-sec-blocked-urls code { background:#fecaca; color:#991b1b; padding:1px 5px; border-radius:3px; }

/* Slug input row */
.fm-slug-input-wrap { display:flex; align-items:center; gap:0; border:1.5px solid #cbd5e1;
	border-radius:8px; overflow:hidden; margin-bottom:8px; background:#fff; }
.fm-slug-prefix { padding:9px 10px; background:#f8fafc; font-size:12px; color:#64748b;
	border-right:1px solid #e2e8f0; white-space:nowrap; font-family:'Courier New',monospace; }
.fm-slug-input { border:none !important; box-shadow:none !important; border-radius:0 !important;
	flex:1; font-size:14px; font-weight:600; color:#1e293b; padding:9px 10px !important; }
.fm-slug-suffix { padding:9px 10px; background:#f8fafc; border-left:1px solid #e2e8f0;
	font-size:13px; color:#64748b; font-family:'Courier New',monospace; }
.fm-slug-preview { font-size:12px; color:#2563eb; font-family:'Courier New',monospace;
	padding:4px 0 12px; min-height:22px; }

.fm-sec-tips { background:#fafbfc; border:1px solid #e2e8f0; border-radius:8px;
	padding:12px 16px; margin-bottom:12px; }
.fm-sec-tips strong { font-size:12px; color:#475569; display:block; margin-bottom:6px; }
.fm-sec-tips ul { margin:0; padding-left:18px; }
.fm-sec-tips li { font-size:12px; color:#64748b; margin-bottom:4px; line-height:1.5; }
.fm-sec-tips code { background:#e2e8f0; padding:1px 5px; border-radius:3px; font-size:11px; }

.fm-pin-field { font-size:18px !important; letter-spacing:4px; max-width:200px; }

/* Security layer summary */
.fm-sec-summary { background:linear-gradient(135deg,#1e293b,#334155) !important;
	border-color:#334155 !important; }
.fm-sec-summary h3 { color:#f1f5f9; margin:0 0 14px; font-size:15px; }
.fm-sec-layers { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media(max-width:700px){ .fm-sec-layers { grid-template-columns:1fr; } }

.fm-sec-layer { display:flex; align-items:center; gap:12px; background:rgba(255,255,255,.07);
	border:1px solid rgba(255,255,255,.1); border-radius:8px; padding:12px 14px; }
.fm-sec-layer.active  { border-color:rgba(134,239,172,.3); background:rgba(134,239,172,.08); }
.fm-sec-layer.inactive{ border-color:rgba(252,165,165,.3); background:rgba(252,165,165,.06); }
.fm-sec-layer-icon { font-size:20px; flex-shrink:0; }
.fm-sec-layer strong { display:block; font-size:13px; color:#f1f5f9; margin-bottom:2px; }
.fm-sec-layer span   { font-size:11px; color:#94a3b8; }

/* ============================================================
   RESPONSIVE — Mobile (≤600px), Tablet (601-900px), Desktop
   ============================================================ */

/* ── Stock badge colors ── */
.fm-stock-ok   { color:#16a34a; font-weight:700; }
.fm-stock-low  { color:#d97706; font-weight:700; }
.fm-stock-zero { color:#dc2626; font-weight:700; }

/* ── Scrollable tables on small screens ── */
.fm-table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.fm-table-scroll .fm-table { min-width:600px; }

/* ── Challan item rows — stack on mobile ── */
@media (max-width: 600px) {

	/* WordPress admin sidebar hide karo — full width lene do */
	#wpcontent { padding-left: 0 !important; margin-left:0 !important; }

	.fm-wrap { margin: 8px 8px 24px !important; }

	/* Page title smaller */
	.fm-page-title { font-size:18px !important; }
	.fm-page-sub   { font-size:12px !important; }

	/* Cards full width, less padding */
	.fm-card { padding:14px 12px !important; border-radius:8px !important; }

	/* All grids → single column */
	.fm-grid-2, .fm-grid-3, .fm-grid-4,
	.fm-attr-grid, .fm-impexp-grid, .fm-stat-grid,
	.fm-sec-layers, .fm-grid-5-col {
		grid-template-columns: 1fr !important;
	}

	/* Header stats hide */
	.fm-header-stats { display:none !important; }

	/* Page header stack */
	.fm-page-header { flex-direction:column; gap:8px; }

	/* Search bar stack */
	.fm-search-row, .fm-search-form { flex-direction:column; }
	.fm-search-row .button, .fm-search-form .button,
	.fm-search-row a.button, .fm-search-form a.button { width:100%; text-align:center; }

	/* Import/export */
	.fm-impexp-grid { grid-template-columns:1fr !important; }

	/* Challan form — item table becomes cards */
	#fm-items-table { display:none; }
	.fm-mobile-item-cards { display:block !important; }

	/* Inline forms stack */
	.fm-inline-row   { flex-direction:column !important; gap:8px !important; }
	.fm-inline-form  { flex-wrap:wrap; }
	.fm-client-selector-row { flex-direction:column !important; }

	/* Slug input wrap */
	.fm-slug-input-wrap { flex-direction:column; border-radius:8px; }
	.fm-slug-prefix, .fm-slug-suffix { border:none; font-size:11px; }

	/* Payment mode bar wrap */
	.fm-payment-mode-bar { flex-wrap:wrap; gap:6px; }
	.fm-pm-option { flex:1; min-width:80px; justify-content:center; }

	/* Buttons full width where needed */
	.fm-form-footer .button,
	.fm-form-footer button { width:100%; margin-bottom:6px; text-align:center; }

	/* Table → card layout */
	.fm-clients-table thead, .fm-responsive-table thead { display:none; }
	.fm-clients-table tr, .fm-responsive-table tr   { display:block; border:1px solid #e2e8f0; border-radius:8px;
		margin-bottom:10px; padding:10px 12px; background:#fff; }
	.fm-clients-table td, .fm-responsive-table td   { display:flex; justify-content:space-between; align-items:center;
		padding:5px 0; border:none; font-size:13px; gap:10px; text-align:right; }
	.fm-clients-table td::before, .fm-responsive-table td::before {
		content: attr(data-label);
		font-weight:700; color:#64748b; font-size:11px;
		text-transform:uppercase; letter-spacing:.4px; flex-shrink:0; margin-right:8px; text-align:left; }
	/* Cells with no meaningful label (checkbox column) collapse the label gap */
	.fm-responsive-table td:not([data-label]),
	.fm-responsive-table td[data-label=""] { justify-content:flex-end; }
	/* Action buttons wrap nicely inside the card */
	.fm-responsive-table td.fm-action-cell { flex-wrap:wrap; justify-content:flex-end; gap:6px; }
	.fm-responsive-table td.fm-action-cell .button { flex:0 0 auto; }

	/* Edit inline full width */
	.fm-inline-edit-box { padding:12px; }

	/* Analytics charts */
	.fm-stat-grid { grid-template-columns:1fr 1fr !important; }
	canvas { max-width:100%; }

	/* Attr cards list scrollable */
	.fm-attr-list { max-height: 200px; }
	.fm-attr-add-row { flex-wrap:wrap; }
	.fm-attr-input  { min-width:100%; }

	/* Security page */
	.fm-security-card-header { flex-wrap:wrap; gap:8px; }
	.fm-sec-current-url { flex-wrap:wrap; font-size:12px; }

	/* Print challan button always visible */
	.fm-view-header { flex-direction:column; gap:8px; align-items:flex-start; }

	/* Quick add modal */
	.fm-modal-box { padding:16px; max-width:100%; margin:8px; }

	/* UPI QR */
	.fm-upi-qr-box { flex-direction:column; text-align:center; }
	.fm-upi-qr-box img { width:140px; height:140px; }
}

/* ── Tablet (601px – 900px) ── */
@media (min-width:601px) and (max-width:900px) {

	.fm-wrap { margin: 12px 12px 30px !important; }
	.fm-card { padding:16px !important; }

	.fm-grid-2    { grid-template-columns:1fr 1fr !important; }
	.fm-grid-4    { grid-template-columns:1fr 1fr !important; }
	.fm-attr-grid { grid-template-columns:1fr 1fr !important; }
	.fm-stat-grid { grid-template-columns:1fr 1fr !important; }
	.fm-sec-layers{ grid-template-columns:1fr 1fr !important; }
	.fm-grid-5-col{ grid-template-columns:1fr 1fr 1fr !important; }
	.fm-impexp-grid { grid-template-columns:1fr 1fr !important; }

	/* Challan item rows — compact but visible */
	.fm-clients-table th:nth-child(5),
	.fm-clients-table td:nth-child(5),
	.fm-clients-table th:nth-child(6),
	.fm-clients-table td:nth-child(6) { display:none; } /* hide GSTIN col */

	.fm-rchallans-table th:nth-child(7),
	.fm-rchallans-table td:nth-child(7),
	.fm-rchallans-table th:nth-child(8),
	.fm-rchallans-table td:nth-child(8) { display:none; } /* hide City + Staff cols */

	.fm-payment-mode-bar { flex-wrap:wrap; }
}

/* ── Mobile challan item cards (replaces table on phones) ── */
.fm-mobile-item-cards { display:none; }

.fm-mobile-item-card {
	background:#fff; border:1px solid #e2e8f0; border-radius:10px;
	padding:14px; margin-bottom:12px; position:relative;
}
.fm-mobile-item-card .fm-mic-row {
	display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:8px;
}
.fm-mobile-item-card label { font-size:11px; font-weight:700; color:#64748b;
	text-transform:uppercase; display:block; margin-bottom:3px; }
.fm-mobile-item-card select,
.fm-mobile-item-card input { width:100%; font-size:14px; padding:8px; border:1px solid #cbd5e1;
	border-radius:6px; box-sizing:border-box; }
.fm-mic-remove { position:absolute; top:10px; right:10px; background:#fee2e2;
	border:none; border-radius:6px; color:#dc2626; padding:4px 8px; cursor:pointer;
	font-size:12px; font-weight:700; }
.fm-mic-stock-badge { display:inline-block; font-size:11px; font-weight:700;
	padding:2px 8px; border-radius:10px; background:#dcfce7; color:#166534; }

/* ── Admin WP menu responsive fix ── */
@media (max-width:782px) {
	.fm-wrap { margin-right:8px !important; }
	.fm-card { overflow-x:auto; }
}

/* ── Touch-friendly buttons ── */
@media (max-width:900px) {
	.button, button[type=submit] { min-height:40px; }
	.fm-btn-icon { width:36px !important; height:36px !important; }
	.fm-btn-icon .dashicons { font-size:18px !important; width:18px !important; height:18px !important; }
	select, input[type=text], input[type=number], input[type=date],
	input[type=password], textarea { font-size:16px !important; } /* prevents iOS zoom */
}

/* ── Sticky save bar on mobile challan form ── */
@media (max-width:600px) {
	.fm-sticky-save {
		position:fixed; bottom:0; left:0; right:0; z-index:999;
		background:#1e293b; padding:12px 16px;
		display:flex; gap:10px; align-items:center;
		box-shadow:0 -4px 20px rgba(0,0,0,.2);
	}
	.fm-sticky-save .button { flex:1; text-align:center; }
	.fm-challan-form-body { padding-bottom:80px; }
}

/* ── Task Manager ── */
.fm-label { display:block; font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.fm-input { padding:9px 12px; border:1px solid #cbd5e1; border-radius:6px; font-size:14px; box-sizing:border-box; font-family:inherit; }

.fm-task-staff-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px; }
.fm-task-staff-chip {
	display:flex; align-items:center; gap:8px; padding:9px 12px;
	border:1.5px solid #e2e8f0; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500;
	transition:.15s;
}
.fm-task-staff-chip:has(input:checked) { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; }
.fm-task-staff-chip input { width:auto; margin:0; }

.fm-task-card { position:relative; padding:18px 20px; }
.fm-task-card.fm-task-done { opacity:.65; background:#fafafa; }
.fm-task-top { display:flex; align-items:flex-start; gap:12px; }
.fm-task-titleblock { flex:1; min-width:0; }
.fm-task-titleblock h3 { margin:0 0 2px; font-size:15px; color:#1e293b; }
.fm-task-card.fm-task-done .fm-task-titleblock h3 { text-decoration:line-through; color:#94a3b8; }
.fm-task-subject { font-size:12px; color:#7c3aed; font-weight:600; }

.fm-task-tick {
	flex-shrink:0; width:30px; height:30px; border-radius:50%;
	border:2px solid #cbd5e1; background:#fff; color:transparent;
	font-size:16px; font-weight:900; line-height:1; cursor:pointer;
	display:flex; align-items:center; justify-content:center;
	transition:.15s;
}
.fm-task-tick:hover { border-color:#16a34a; }
.fm-task-tick.is-done { background:#16a34a; border-color:#16a34a; color:#fff; }

.fm-task-notes { font-size:13px; color:#475569; margin:10px 0; white-space:pre-line; }
.fm-task-meta { display:flex; flex-wrap:wrap; gap:14px; font-size:12px; color:#64748b; align-items:center; margin-top:8px; }

.fm-task-attachments { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.fm-task-attachment-chip {
	display:inline-flex; align-items:center; gap:6px; padding:6px 10px;
	background:#f1f5f9; border-radius:6px; font-size:12px; color:#334155;
	text-decoration:none; border:1px solid #e2e8f0;
}
.fm-task-attachment-chip:hover { background:#e2e8f0; }

.fm-task-card.fm-task-overdue { background:#fff5f5; }
.fm-task-overdue-text { color:#dc2626 !important; font-weight:700; }

.fm-task-priority-badge {
	flex-shrink:0; font-size:10px; font-weight:700; text-transform:uppercase;
	letter-spacing:.4px; padding:3px 9px; border-radius:20px; align-self:flex-start;
}

.fm-task-proof-upload { margin-top:12px; }
.fm-task-proof-btn { cursor:pointer; font-size:12px; }

.fm-task-comments { margin-top:14px; padding-top:12px; border-top:1px solid #f1f5f9; }
.fm-task-comments-list { display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.fm-task-comment { display:flex; gap:9px; align-items:flex-start; }
.fm-task-comment-avatar {
	flex-shrink:0; width:30px; height:30px; border-radius:50%;
	display:flex; align-items:center; justify-content:center;
	color:#fff; font-size:11px; font-weight:700; letter-spacing:.3px;
}
.fm-task-comment-avatar-sm { width:28px; height:28px; font-size:10.5px; }
.fm-task-comment-bubble { flex:1; background:#f8fafc; border-radius:10px; padding:8px 12px; min-width:0; }
.fm-task-comment-head { display:flex; justify-content:space-between; gap:8px; margin-bottom:2px; }
.fm-task-comment-head strong { font-size:12px; color:#1e293b; }
.fm-task-comment-time { color:#94a3b8; font-size:10.5px; flex-shrink:0; white-space:nowrap; }
.fm-task-comment-text { font-size:12.5px; color:#334155; line-height:1.5; word-break:break-word; }
.fm-task-comment-form { display:flex; gap:8px; align-items:center; }
.fm-task-comment-form input { flex:1; }

@media (max-width:600px) {
	.fm-task-staff-grid { grid-template-columns:1fr 1fr; }
	.fm-task-meta { flex-direction:column; align-items:flex-start; gap:4px; }
	.fm-task-top { flex-wrap:wrap; }
	.fm-task-priority-badge { order:3; }
}
