/* ─────────────────────────────────────────────────────────────
   Shared Create / Edit form design system
   Used by all create.blade.php and edit.blade.php pages
   ───────────────────────────────────────────────────────────── */

/* ── Page wrapper ────────────────────────────────────────────── */
.fc-wrap { max-width: 1100px; margin: 0 auto; }
.fc-wrap-md { max-width: 780px; margin: 0 auto; }
.fc-wrap-sm { max-width: 600px; margin: 0 auto; }

/* ── Page header ─────────────────────────────────────────────── */
.fc-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.fc-header-left { display: flex; align-items: center; gap: 14px; }
.fc-header-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,.3); flex-shrink: 0;
}
.fc-header-icon.indigo  { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.fc-header-icon.emerald { background: linear-gradient(135deg,#059669,#10b981); }
.fc-header-icon.amber   { background: linear-gradient(135deg,#d97706,#f59e0b); }
.fc-header-icon.rose    { background: linear-gradient(135deg,#e11d48,#f43f5e); }
.fc-header-icon.sky     { background: linear-gradient(135deg,#0284c7,#38bdf8); }
.fc-header-icon.violet  { background: linear-gradient(135deg,#7c3aed,#a855f7); }
.fc-header-icon.slate   { background: linear-gradient(135deg,#475569,#64748b); }
.fc-title { font-size: 22px; font-weight: 700; color: #0f172a; letter-spacing: -.4px; }
.fc-subtitle { font-size: 13px; color: #64748b; margin-top: 2px; }

/* ── Section cards ───────────────────────────────────────────── */
.fc-section {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    padding: 24px 28px; margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(15,23,42,.04);
}
.fc-section-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.fc-section-icon {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fc-section-icon.indigo  { background: #eef2ff; }
.fc-section-icon.violet  { background: #f5f3ff; }
.fc-section-icon.emerald { background: #ecfdf5; }
.fc-section-icon.amber   { background: #fffbeb; }
.fc-section-icon.rose    { background: #fff1f2; }
.fc-section-icon.sky     { background: #e0f2fe; }
.fc-section-icon.slate   { background: #f1f5f9; }
.fc-section-title { font-size: 14px; font-weight: 700; color: #1e293b; }
.fc-section-desc  { font-size: 12px; color: #94a3b8; margin-top: 1px; }

/* ── Form labels ─────────────────────────────────────────────── */
.fc-label {
    display: block; font-size: 12px; font-weight: 600;
    color: #374151; margin-bottom: 6px; letter-spacing: .2px;
}
.fc-label .req { color: #ef4444; margin-left: 2px; }
.fc-hint { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }

/* ── Inputs / selects / textareas ────────────────────────────── */
.fc-input, .fc-select {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 9px 13px; font-size: 13.5px; background: #fff;
    color: #1e293b; transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box; font-family: inherit;
}
.fc-input:focus, .fc-select:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.fc-input::placeholder { color: #cbd5e1; }
.fc-input[readonly], .fc-input:disabled { background: #f8fafc; color: #475569; cursor: default; }
.fc-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    appearance: none; padding-right: 36px;
}
.fc-textarea {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 9px 13px; font-size: 13.5px; background: #fff;
    color: #1e293b; resize: vertical; font-family: inherit;
    transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
    min-height: 80px;
}
.fc-textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.fc-textarea::placeholder { color: #cbd5e1; }

/* display-only field */
.fc-display {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 9px 13px; font-size: 13.5px; background: #f8fafc;
    color: #475569; box-sizing: border-box; min-height: 40px;
    display: flex; align-items: center;
}

/* currency prefix wrapper */
.fc-currency-wrap { position: relative; }
.fc-currency-wrap .fc-sym {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 13px; color: #94a3b8; pointer-events: none; z-index: 1;
}
.fc-currency-wrap .fc-input { padding-left: 26px; }

/* ── Grid helpers ────────────────────────────────────────────── */
.fc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.fc-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 768px) {
    .fc-grid-2, .fc-grid-3, .fc-grid-4 { grid-template-columns: 1fr; }
}
.fc-span-2 { grid-column: span 2; }
.fc-span-3 { grid-column: span 3; }

/* ── Info / balance panel ────────────────────────────────────── */
.fc-info-panel {
    background: linear-gradient(135deg,#f0f9ff,#e0f2fe);
    border: 1.5px solid #bae6fd; border-radius: 14px;
    padding: 18px 22px; margin-bottom: 20px;
}
.fc-info-panel-title {
    font-size: 11px; font-weight: 700; color: #0369a1;
    text-transform: uppercase; letter-spacing: .7px; margin-bottom: 14px;
    display: flex; align-items: center; gap: 6px;
}
.fc-stat { }
.fc-stat-label { font-size: 11.5px; color: #64748b; font-weight: 500; margin-bottom: 3px; }
.fc-stat-value { font-size: 18px; font-weight: 700; color: #1e293b; }
.fc-stat-value.positive { color: #15803d; }
.fc-stat-value.negative { color: #dc2626; }

/* ── Item picker ─────────────────────────────────────────────── */
.fc-item-picker {
    background: linear-gradient(135deg,#fafafa,#f8fafc);
    border: 1.5px dashed #d1d5db; border-radius: 14px;
    padding: 20px 22px; margin-bottom: 20px;
}
.fc-item-picker-title {
    font-size: 12px; font-weight: 700; color: #6366f1;
    text-transform: uppercase; letter-spacing: .7px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 6px;
}
.fc-picker-grid {
    display: grid; gap: 12px; align-items: end;
}
.fc-picker-grid.cols-6 { grid-template-columns: 1.2fr 1.4fr 1fr 1fr 0.8fr 0.8fr; }
.fc-picker-grid.cols-5 { grid-template-columns: 1.4fr 1.4fr 1fr 0.8fr 0.8fr; }
@media (max-width: 900px) {
    .fc-picker-grid.cols-6,
    .fc-picker-grid.cols-5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
    .fc-picker-grid.cols-6,
    .fc-picker-grid.cols-5 { grid-template-columns: 1fr; }
}

/* ── Stock pill ──────────────────────────────────────────────── */
.fc-stock-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px; border-radius: 100px; font-size: 12px; font-weight: 600;
}
.fc-stock-pill.ok  { background: #dcfce7; color: #15803d; }
.fc-stock-pill.low { background: #fef3c7; color: #92400e; }
.fc-stock-pill.na  { background: #f1f5f9; color: #64748b; }

/* ── Items table ─────────────────────────────────────────────── */
.fc-table-wrap {
    border: 1.5px solid #e2e8f0; border-radius: 14px;
    overflow: hidden; margin-bottom: 8px;
}
.fc-table { width: 100%; border-collapse: collapse; }
.fc-table thead { background: linear-gradient(90deg,#f8fafc,#f1f5f9); }
.fc-table th {
    padding: 11px 16px; font-size: 11px; font-weight: 700;
    color: #64748b; text-transform: uppercase; letter-spacing: .6px;
    text-align: left; border-bottom: 1px solid #e2e8f0;
}
.fc-table td {
    padding: 12px 16px; font-size: 13.5px; color: #1e293b;
    border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
.fc-table tbody tr:last-child td { border-bottom: none; }
.fc-table tbody tr { transition: background .12s; }
.fc-table tbody tr:hover { background: #fafbff; }
.fc-table .fc-item-name { font-weight: 600; }
.fc-wh-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; background: #eef2ff; color: #4f46e5;
    padding: 3px 9px; border-radius: 100px; font-weight: 500;
}
.fc-type-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; padding: 2px 8px; border-radius: 100px; font-weight: 600;
}
.tb-physical { background: #ede9fe; color: #5b21b6; }
.tb-virtual  { background: #dbeafe; color: #1d4ed8; }
.tb-service  { background: #d1fae5; color: #065f46; }

/* editable inline table input */
.fc-table-input {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 6px 10px; font-size: 13px; font-family: inherit;
    background: #fff; transition: border-color .15s;
}
.fc-table-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.fc-table-input[readonly] { background: #f8fafc; color: #64748b; }

/* ── Empty state ─────────────────────────────────────────────── */
.fc-empty {
    text-align: center; padding: 40px 20px; color: #94a3b8;
}
.fc-empty svg { margin: 0 auto 12px; display: block; opacity: .4; }
.fc-empty p { font-size: 14px; }

/* ── Totals panel ────────────────────────────────────────────── */
.fc-totals-panel {
    background: linear-gradient(135deg,#fafafa,#f8fafc);
    border: 1.5px solid #e2e8f0; border-radius: 16px;
    padding: 24px 28px;
}
.fc-grand-box {
    background: linear-gradient(135deg,#6366f1,#7c3aed);
    border-radius: 14px; padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 16px; box-shadow: 0 4px 16px rgba(99,102,241,.3);
}
.fc-grand-box .fc-gt-label { color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.fc-grand-box .fc-gt-sub   { color: rgba(255,255,255,.55); font-size: 11px; margin-top: 2px; }
.fc-grand-box .fc-gt-amount { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.5px; }

/* balance-specific totals (payments) */
.fc-balance-box {
    background: linear-gradient(135deg,#0f172a,#1e293b);
    border-radius: 14px; padding: 18px 22px;
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 16px; box-shadow: 0 4px 16px rgba(15,23,42,.25);
}
.fc-balance-box .fc-bl-label  { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; }
.fc-balance-box .fc-bl-amount { font-size: 24px; font-weight: 800; color: #fff; }

/* Journal debit/credit totals */
.fc-jv-totals {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 16px;
}
@media (max-width: 600px) { .fc-jv-totals { grid-template-columns: 1fr; } }
.fc-jv-total-box {
    border-radius: 12px; padding: 14px 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.fc-jv-total-box.debit  { background: #eff6ff; border: 1.5px solid #bfdbfe; }
.fc-jv-total-box.credit { background: #f0fdf4; border: 1.5px solid #bbf7d0; }
.fc-jv-total-box.balance { background: #fafafa; border: 1.5px solid #e2e8f0; }
.fc-jv-total-box .jv-label  { font-size: 12px; color: #64748b; font-weight: 600; }
.fc-jv-total-box .jv-value  { font-size: 18px; font-weight: 800; color: #1e293b; }

/* ── Buttons ─────────────────────────────────────────────────── */
.fc-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 28px; background: linear-gradient(135deg,#6366f1,#7c3aed);
    color: #fff; border: none; border-radius: 11px; font-size: 14px;
    font-weight: 600; cursor: pointer; transition: all .15s;
    box-shadow: 0 4px 14px rgba(99,102,241,.35); font-family: inherit; text-decoration: none;
}
.fc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.45); color: #fff; }

.fc-btn-secondary {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 22px; background: #fff; color: #374151;
    border: 1.5px solid #d1d5db; border-radius: 11px; font-size: 14px;
    font-weight: 600; text-decoration: none; cursor: pointer; transition: all .15s;
    font-family: inherit;
}
.fc-btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; color: #374151; }

.fc-btn-danger {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 22px; background: #fff; color: #dc2626;
    border: 1.5px solid #fca5a5; border-radius: 11px; font-size: 14px;
    font-weight: 600; text-decoration: none; cursor: pointer; transition: all .15s;
    font-family: inherit;
}
.fc-btn-danger:hover { background: #fef2f2; border-color: #f87171; color: #b91c1c; }

.fc-btn-add {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; background: linear-gradient(135deg,#6366f1,#7c3aed);
    color: #fff; border: none; border-radius: 10px; font-size: 13.5px;
    font-weight: 600; cursor: pointer; transition: all .15s;
    box-shadow: 0 2px 8px rgba(99,102,241,.3); font-family: inherit;
}
.fc-btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.4); }

.fc-btn-remove {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 11px; background: #fee2e2; color: #dc2626;
    border: none; border-radius: 7px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all .15s; font-family: inherit;
}
.fc-btn-remove:hover { background: #fecaca; }

.fc-btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: transparent; color: #6366f1;
    border: 1.5px solid #c7d2fe; border-radius: 9px; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all .15s; font-family: inherit;
}
.fc-btn-ghost:hover { background: #eef2ff; }

/* ── Action bar ──────────────────────────────────────────────── */
.fc-action-bar {
    display: flex; gap: 12px; justify-content: flex-end;
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid #e2e8f0; flex-wrap: wrap;
}

/* ── Error banner ────────────────────────────────────────────── */
.fc-errors {
    background: #fef2f2; border: 1.5px solid #fecaca; border-radius: 12px;
    padding: 14px 18px; margin-bottom: 20px;
    display: flex; gap: 10px; align-items: flex-start;
}
.fc-errors ul { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #dc2626; }
.fc-errors ul li::before { content: "· "; font-weight: 700; }

/* ── Permission group (roles) ────────────────────────────────── */
.fc-perm-group {
    border: 1.5px solid #e2e8f0; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
}
.fc-perm-group-header {
    background: #f8fafc; padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; font-weight: 700; color: #374151;
    border-bottom: 1px solid #e2e8f0;
}
.fc-perm-group-body { padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .fc-perm-group-body { grid-template-columns: 1fr; } }
.fc-perm-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 7px;
    transition: background .1s;
}
.fc-perm-check:hover { background: #f0f4ff; }
.fc-perm-check input[type="checkbox"] { accent-color: #6366f1; width: 14px; height: 14px; cursor: pointer; }

/* ── Role check pill (users) ─────────────────────────────────── */
.fc-role-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border: 1.5px solid #e2e8f0; border-radius: 11px;
    cursor: pointer; transition: all .15s; background: #fff;
}
.fc-role-card:hover { border-color: #a5b4fc; background: #fafbff; }
.fc-role-card input[type="checkbox"] { accent-color: #6366f1; width: 15px; height: 15px; }
.fc-role-card.checked { border-color: #6366f1; background: #eef2ff; }

/* ── Preview box (stock adj) ─────────────────────────────────── */
.fc-preview {
    background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 12px;
    padding: 14px 18px; display: flex; gap: 10px; align-items: flex-start;
}
.fc-preview p { font-size: 13px; color: #92400e; margin: 0; }

/* ── Quotation loader bar ────────────────────────────────────── */
.fc-quotation-bar {
    background: linear-gradient(135deg,#f0f9ff,#e0f2fe);
    border: 1.5px solid #bae6fd; border-radius: 12px;
    padding: 14px 18px; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.fc-quotation-bar-text { font-size: 13px; color: #0369a1; font-weight: 500; }

/* ── Modal ───────────────────────────────────────────────────── */
.fc-modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,.55); z-index: 50;
    align-items: center; justify-content: center; padding: 1rem;
}
.fc-modal-backdrop.open { display: flex; }
.fc-modal {
    background: #fff; border-radius: 18px; width: min(100%, 760px);
    box-shadow: 0 20px 60px rgba(15,23,42,.18); overflow: hidden;
}
.fc-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.fc-modal-title { font-size: 15px; font-weight: 700; color: #1e293b; }
.fc-modal-close {
    width: 30px; height: 30px; border: none; background: #e2e8f0;
    border-radius: 8px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; color: #64748b; transition: all .15s;
}
.fc-modal-close:hover { background: #fecaca; color: #dc2626; }
.fc-modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
