@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';
@source '../**/*.vue';

@theme {
    --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Bengali', 'Hind Siliguri', sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji';
    --color-brand-50: #f0fdfa;
    --color-brand-100: #ccfbf1;
    --color-brand-500: #14b8a6;
    --color-brand-600: #0d9488;
    --color-brand-700: #0f766e;
    --color-brand-800: #115e59;
    --color-brand-900: #134e4a;
}

@layer base {
    html {
        -webkit-tap-highlight-color: transparent;
    }
    button, [role='button'] {
        cursor: pointer;
    }
    button:disabled {
        cursor: not-allowed;
    }
    input[type='number']::-webkit-inner-spin-button,
    input[type='number']::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    input[type='number'] {
        -moz-appearance: textfield;
    }
}

@layer components {
    .btn {
        @apply inline-flex min-h-11 items-center justify-center gap-2 rounded-lg px-4 text-sm font-medium transition select-none
            focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-600/40 disabled:opacity-50;
    }
    .btn-primary {
        @apply bg-brand-700 text-white hover:bg-brand-800 active:bg-brand-900;
    }
    .btn-secondary {
        @apply border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 active:bg-slate-100;
    }
    .btn-ghost {
        @apply text-slate-600 hover:bg-slate-100 active:bg-slate-200;
    }
    .btn-danger {
        @apply bg-red-600 text-white hover:bg-red-700;
    }
    .btn-sm {
        @apply min-h-9 px-3 text-xs;
    }
    .btn-lg {
        @apply min-h-14 px-6 text-base;
    }
    .btn-icon {
        @apply inline-flex h-11 w-11 items-center justify-center rounded-lg text-slate-600 hover:bg-slate-100 active:bg-slate-200;
    }
    .input {
        @apply block min-h-11 w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400
            focus:border-brand-600 focus:outline-none focus:ring-2 focus:ring-brand-600/20 disabled:bg-slate-100;
    }
    .input-error {
        @apply border-red-400 focus:border-red-500 focus:ring-red-500/20;
    }
    .label {
        @apply mb-1 block text-sm font-medium text-slate-700;
    }
    .field-error {
        @apply mt-1 text-xs text-red-600;
    }
    .card {
        @apply rounded-xl border border-slate-200 bg-white shadow-sm;
    }
    .badge {
        @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium;
    }
    .badge-green {
        @apply bg-emerald-100 text-emerald-800;
    }
    .badge-amber {
        @apply bg-amber-100 text-amber-800;
    }
    .badge-red {
        @apply bg-red-100 text-red-700;
    }
    .badge-slate {
        @apply bg-slate-100 text-slate-600;
    }
    .badge-blue {
        @apply bg-sky-100 text-sky-800;
    }
    .chip {
        @apply inline-flex min-h-9 shrink-0 items-center rounded-full border border-slate-300 bg-white px-3 text-sm text-slate-700 whitespace-nowrap;
    }
    .chip-active {
        @apply border-brand-700 bg-brand-700 text-white;
    }
    .table {
        @apply w-full text-left text-sm;
    }
    .table th {
        @apply border-b border-slate-200 bg-slate-50 px-3 py-2.5 text-xs font-semibold tracking-wide text-slate-500 uppercase;
    }
    .table td {
        @apply border-b border-slate-100 px-3 py-2.5 align-middle;
    }
    .num {
        font-variant-numeric: tabular-nums;
    }
}

/* Safe-area padding for installed PWA on notched phones */
/* These ADD the notch / home-bar inset to the normal padding (instead of replacing it,
   which left footers with no bottom padding on desktop and Android where the inset is 0). */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pb-safe-2 {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}
.pb-safe-3 {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.pb-safe-4 {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

/* ---------- Printing ---------- */
#print-root {
    display: none;
}

@media print {
    body > *:not(#print-root) {
        display: none !important;
    }
    body {
        background: #fff !important;
    }
    #print-root {
        display: block !important;
    }
}

.receipt {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Noto Sans Bengali', monospace;
    color: #000;
    background: #fff;
    font-size: 12px;
    line-height: 1.35;
}
.receipt.paper-58mm {
    width: 48mm;
    font-size: 10.5px;
}
.receipt.paper-80mm {
    width: 72mm;
}
.receipt.paper-A4 {
    width: 100%;
    max-width: 180mm;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
}
.receipt .dash {
    border-top: 1px dashed #000;
    margin: 4px 0;
}
.receipt table {
    width: 100%;
    border-collapse: collapse;
}
.receipt td,
.receipt th {
    padding: 1px 0;
    vertical-align: top;
}

.labels-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, 50mm);
    gap: 2mm;
}
.label-cell {
    width: 50mm;
    height: 30mm;
    border: 1px dashed #cbd5e1;
    padding: 1.5mm;
    overflow: hidden;
    text-align: center;
    break-inside: avoid;
    font-family: ui-sans-serif, system-ui, sans-serif;
    color: #000;
}
@media print {
    .label-cell {
        border-color: transparent;
    }
}
