/* FlowPlus Admin Panel - Modern UI Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --dark-3: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;
    --sidebar-width: 260px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: Calibri, 'Segoe UI', Tahoma, Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-family);
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea,
table,
th,
td,
.data-table,
.modal,
.btn {
    font-family: var(--font-family);
}

.ts-wrapper,
.ts-wrapper .ts-control,
.ts-wrapper .ts-dropdown,
.select2-container,
.select2-container .select2-selection,
.select2-dropdown {
    font-family: var(--font-family) !important;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========== AUTH LAYOUT ========== */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.auth-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.auth-logo p {
    color: var(--gray);
    font-size: 14px;
    margin-top: 4px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--gray);
    text-align: center;
    margin-bottom: 28px;
    font-size: 13px;
}

/* ========== FORMS ========== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark-3);
    margin-bottom: 6px;
}

.form-input-wrapper {
    position: relative;
}

.form-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    pointer-events: none;
}

.form-input-icon svg {
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-control.no-icon {
    padding: 12px 14px 12px 12px;
}

.form-control[readonly] {
    background: #f1f5f9;
    color: var(--gray);
    cursor: not-allowed;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 13px;
    color: var(--gray);
    cursor: pointer;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ========== BUTTONS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: var(--dark-3);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ========== AUTH FOOTER ========== */

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--gray);
}

.auth-footer a {
    font-weight: 600;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ========== ALERTS ========== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease-out;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========== ADMIN LAYOUT ========== */

.admin-body {
    min-height: 100vh;
    background: #f8fafc;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, #1e1b4b 100%);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.sidebar-brand-text h2 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-brand-text span {
    color: var(--gray-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav-label {
    color: var(--gray-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.sidebar-link.logout-link {
    color: #fca5a5;
}

.sidebar-link.logout-link:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    color: var(--gray-light);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    padding: 16px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.topbar-title p {
    font-size: 13px;
    color: var(--gray);
}

.page-content {
    padding: 32px;
    flex: 1;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #f1f5f9;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 22px;
    height: 22px;
}

.stat-card-icon.purple {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-card-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.content-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.content-card-body {
    padding: 24px;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    padding: 32px;
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -30px;
}

.welcome-banner h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    opacity: 0.9;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* ========== MODAL ========== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

#piLineItemModal {
    z-index: 1001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px 24px 0;
    text-align: center;
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: #fef2f2;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-icon svg {
    width: 28px;
    height: 28px;
    color: var(--danger);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--gray);
    font-size: 14px;
}

.modal-footer {
    padding: 24px;
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
}

.modal--wide,
.modal.modal--wide,
.pi-line-modal.modal {
    max-width: 820px;
}

.product-edit-modal.modal {
    max-width: 720px;
    text-align: left;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 860px);
}

.product-edit-modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.product-edit-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.product-edit-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 4px;
    text-align: left;
}

.product-edit-modal-header p {
    color: var(--gray);
    font-size: 13px;
    margin: 0;
    text-align: left;
}

.product-edit-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
}

.product-edit-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.product-edit-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.product-edit-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.product-edit-modal-footer .btn {
    flex: 1;
}

.product-edit-modal .form-error {
    font-size: 12px;
    margin-top: 4px;
}

.pi-line-modal {
    text-align: left;
    overflow: visible;
}

.pi-line-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 0;
}

.pi-line-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    text-align: left;
}

.pi-line-modal-header p {
    color: var(--gray);
    font-size: 13px;
    text-align: left;
}

.pi-line-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
}

.pi-line-modal-close:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.pi-line-modal-body {
    padding: 20px 24px 24px;
    overflow: visible;
}

.pi-line-modal-body .form-group {
    margin-bottom: 0;
}

.pi-line-modal-body .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.pi-line-modal-body .form-control {
    border-radius: 8px;
    border-color: #dbe3ef;
    font-size: 13px;
    padding: 10px 12px;
}

.pi-line-modal-body .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.pi-line-modal-body .pi-type-select {
    max-width: 220px;
    font-weight: 600;
    color: var(--primary-dark);
    background: #f8faff;
}

.pi-modal-type-row {
    margin-bottom: 4px;
}

.pi-modal-product-slots {
    margin: 18px 0 20px;
    overflow: visible;
    position: relative;
    z-index: 2;
}

.pi-modal-product-slots .pi-product-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pi-modal-product-slots .pi-product-slots--multi {
    display: grid;
    gap: 12px;
    align-items: stretch;
}

.pi-modal-product-slots .pi-product-slots--count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pi-modal-product-slots .pi-product-slots--count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pi-modal-rates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.pi-modal-rates-grid .form-group {
    margin: 0;
}

.pi-modal-rates-grid .form-label {
    font-size: 11px;
    margin-bottom: 6px;
}

.pi-modal-rates-grid .pi-field-hidden {
    display: none !important;
}

.pi-num-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pi-rate-input {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.pi-line-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #f1f5f9;
}

.pi-line-modal-footer .btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    padding: 11px 20px;
    min-height: 42px;
}

.pi-line-modal-footer .btn-outline {
    min-width: 100px;
}

.pi-line-modal-footer .btn-primary {
    min-width: 168px;
}

.pi-amount-preview {
    font-weight: 700;
    color: var(--primary-dark);
    background: #eef2ff !important;
}

/* Shared PI product picker (table + modal) */
.pi-products-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: 12px;
}

.pi-products-placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 700;
    flex-shrink: 0;
}

.pi-products-placeholder--loading .pi-products-placeholder-icon {
    animation: piPulse 1s ease-in-out infinite;
}

@keyframes piPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

.pi-product-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pi-product-slots--multi {
    display: grid;
    gap: 10px;
    align-items: stretch;
}

.pi-product-slots--count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pi-product-slots--count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pi-product-slot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-width: 0;
}

.pi-product-slot--pump {
    border-top: 3px solid #3b82f6;
}

.pi-product-slot--motor {
    border-top: 3px solid #f59e0b;
}

.pi-product-slot--controller {
    border-top: 3px solid #8b5cf6;
}

.pi-product-slot--product {
    border-top: 3px solid var(--primary);
}

.pi-product-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pi-slot-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
}

.pi-stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.pi-stock-badge--empty {
    background: #fef2f2;
    color: #dc2626;
}

.pi-stock-badge--ok {
    background: #ecfdf5;
    color: #059669;
}

.pi-slot-search-hint,
.pi-slot-empty-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #64748b;
}

.pi-slot-empty-hint {
    color: #dc2626;
}

.pi-product-slot .form-control,
.pi-product-slot .row-product-select,
.pi-product-slot .modal-product-select {
    font-size: 12px;
    line-height: 1.3;
    min-height: 38px;
}

.pi-product-slot .ts-wrapper {
    width: 100%;
}

.pi-product-slot .ts-wrapper .ts-control {
    min-height: 42px;
    border-radius: var(--radius);
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    padding: 8px 10px;
}

.pi-product-slot .ts-wrapper.focus .ts-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.pi-product-slot .ts-wrapper .ts-dropdown {
    z-index: 10050;
    font-size: 12px;
}

.pi-product-slot .ts-wrapper .ts-dropdown .dropdown-input {
    font-size: 12px;
    padding: 8px 10px;
}

.pi-product-slot .ts-wrapper .ts-dropdown .option {
    padding: 8px 10px;
}

/* ========== PI MODAL SELECT2 ========== */

#piLineItemModal .select2-container {
    width: 100% !important;
    z-index: 1;
}

#piLineItemModal .select2-container--open {
    z-index: 10002;
}

#piLineItemModal .select2-container--default .select2-selection--single {
    min-height: 42px;
    height: auto;
    border: 1.5px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 4px 8px;
}

#piLineItemModal .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dark);
    font-size: 12px;
    line-height: 1.4;
    padding-left: 4px;
    padding-right: 24px;
}

#piLineItemModal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 6px;
}

#piLineItemModal .select2-container--default.select2-container--focus .select2-selection--single,
#piLineItemModal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

#piLineItemModal .select2-dropdown {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    z-index: 10003 !important;
    overflow: hidden;
}

#piLineItemModal .select2-search--dropdown {
    padding: 8px;
}

#piLineItemModal .select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    outline: none;
}

#piLineItemModal .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

#piLineItemModal .select2-results__option {
    font-size: 12px;
    padding: 8px 10px;
}

#piLineItemModal .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-dark);
}

#piLineItemModal .select2-results__options {
    max-height: 240px;
}

@media (max-width: 768px) {
    .modal--wide {
        max-width: 100%;
    }

    .pi-modal-product-slots .pi-product-slots--count-3,
    .pi-modal-product-slots .pi-product-slots--count-2 {
        grid-template-columns: 1fr;
    }

    .pi-modal-rates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========== DATA TABLES ========== */

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-icon-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-icon-action svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.btn-icon-action--outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-icon-action--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-icon-action--primary:hover {
    background: var(--primary-dark, #4f46e5);
    border-color: var(--primary-dark, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.28);
}

.btn-icon-action--danger {
    background: #fff;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-icon-action--danger:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.btn-icon-action[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    padding: 5px 8px;
    border-radius: 6px;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-icon-action[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: #0f172a;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}

.btn-icon-action[data-tooltip]:hover::after,
.btn-icon-action[data-tooltip]:hover::before,
.btn-icon-action[data-tooltip]:focus-visible::after,
.btn-icon-action[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========== BADGES ========== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-gray { background: #f1f5f9; color: var(--dark-3); }
.badge-purple { background: rgba(99, 102, 241, 0.1); color: var(--primary-dark); }
.badge-cyan { background: rgba(6, 182, 212, 0.1); color: #0891b2; }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-orange { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
.badge-red { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* ========== FORM LAYOUTS ========== */

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Sales Order form */
.so-items-card {
    margin-bottom: 0;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.so-items-body {
    padding: 0;
}

.so-items-table {
    min-width: 1180px;
    margin: 0;
}

.so-items-table th {
    font-size: 11px;
    white-space: nowrap;
    padding: 10px 8px;
    vertical-align: middle;
}

.so-items-table td {
    padding: 8px 6px;
    vertical-align: middle;
}

.so-items-table .form-control {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    border-color: #dbe3ef;
    box-sizing: border-box;
}

.so-items-table .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.so-items-table .so-col-sr { width: 46px; text-align: center; }
.so-items-table .so-col-item { min-width: 110px; }
.so-items-table .so-col-hp { width: 70px; }
.so-items-table .so-col-model { min-width: 90px; }
.so-items-table .so-col-head { width: 80px; }
.so-items-table .so-col-dc { width: 70px; }
.so-items-table .so-col-of { width: 70px; }
.so-items-table .so-col-outlet { width: 80px; }
.so-items-table .so-col-pump { min-width: 100px; }
.so-items-table .so-col-motor { min-width: 120px; }
.so-items-table .so-col-ctrl { min-width: 140px; }
.so-items-table .so-col-qty { width: 78px; }
.so-items-table .so-col-action { width: 52px; text-align: center; }

.so-items-table .so-sr {
    text-align: center;
    font-weight: 600;
    color: #64748b;
}

.so-items-table .so-qty {
    text-align: center;
}

.so-items-table .so-remove-btn {
    min-width: 34px;
    padding: 4px 8px;
    line-height: 1.2;
}

.laser-slip-items-table .form-control {
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
}

.laser-slip-items-table td {
    vertical-align: middle;
}

.laser-slip-items-table .row-product-code {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
}

.laser-slip-items-table .row-start.is-conflict,
.laser-slip-items-table .row-end.is-conflict {
    border-color: #ef4444;
    background: #fef2f2;
}

/* ========== PI LINE ITEMS ========== */

.pi-items-panel {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pi-items-panel .table-responsive {
    margin: 0;
    overflow-x: auto;
}

.pi-items-table {
    margin: 0;
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.pi-items-table thead th {
    padding: 10px 8px;
    font-size: 11px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    line-height: 1.25;
}

.pi-items-table tbody td,
.pi-items-table tfoot td {
    padding: 10px 8px;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: normal;
}

.pi-items-table thead th.right,
.pi-items-table tbody td.pi-cell-qty,
.pi-items-table tbody td.pi-cell-rate,
.pi-items-table tbody td.pi-cell-discount,
.pi-items-table tbody td.pi-cell-amount,
.pi-items-table tfoot td.right {
    text-align: right;
}

.pi-items-table .center,
.pi-items-table tbody td.center,
.pi-items-table tfoot td.center {
    text-align: center;
}

.pi-items-table tbody td.pi-cell-qty,
.pi-items-table tbody td.pi-cell-rate,
.pi-items-table tbody td.pi-cell-discount,
.pi-items-table tbody td.pi-cell-amount,
.pi-items-table tbody td.pi-cell-type,
.pi-items-table tbody td.pi-cell-index,
.pi-items-table tbody td.pi-cell-action {
    vertical-align: middle;
}

.pi-items-table tbody tr.pi-line-row {
    transition: background 0.2s ease;
}

.pi-items-table tbody tr.pi-line-row:hover td {
    background: #fafbff;
}

.pi-items-table .form-control {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 7px 8px;
    font-size: 13px;
    border-radius: 8px;
    border-color: #dbe3ef;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.pi-items-table .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.pi-items-table .pi-type-select {
    font-weight: 600;
    color: var(--primary-dark);
    background: #f8faff;
}

.pi-items-table .pi-num-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pi-items-table .pi-rate-input {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.pi-items-table .pi-row-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #eef2ff;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.pi-items-table .pi-cell-index,
.pi-items-table thead th.pi-cell-index {
    width: 52px;
}

.pi-items-table .pi-cell-type,
.pi-items-table thead th.pi-cell-type {
    width: 78px;
}

.pi-items-table .pi-cell-products,
.pi-items-table .row-products-cell,
.pi-items-table thead th.pi-cell-products {
    width: 34%;
    min-width: 280px;
    vertical-align: middle;
}

.pi-items-table .pi-cell-qty,
.pi-items-table thead th.pi-cell-qty {
    width: 70px;
}

.pi-items-table .pi-qty-input {
    display: block;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    margin-left: auto;
    padding: 7px 6px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

.pi-items-table .pi-gst-input {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    margin-left: auto;
    display: block;
    padding: 7px 6px;
    text-align: center;
    font-weight: 600;
}

.pi-items-table .pi-discount-input {
    display: block;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    margin-left: auto;
    padding: 7px 6px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

.pi-items-table .pi-cell-gst,
.pi-items-table thead th.pi-cell-gst {
    width: 70px;
}

.pi-items-table .pi-cell-gst-amt,
.pi-items-table .pi-cell-taxable,
.pi-items-table thead th.pi-cell-gst-amt,
.pi-items-table thead th.pi-cell-taxable {
    width: 100px;
}

.pi-gst-blank {
    border-color: #f59e0b !important;
    background: #fffbeb;
}

.pi-gst-blank-hint {
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

.pi-items-table .pi-cell-rate,
.pi-items-table .pi-cell-discount,
.pi-items-table thead th.pi-cell-rate,
.pi-items-table thead th.pi-cell-discount {
    width: 92px;
}

.pi-items-table .pi-cell-amount,
.pi-items-table thead th.pi-cell-amount {
    width: 110px;
}

.pi-items-table .pi-cell-action,
.pi-items-table thead th.pi-cell-action {
    width: 84px;
    vertical-align: middle;
}

.pi-items-table .pi-amount-value {
    display: inline-block;
    min-width: 84px;
    padding: 7px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.pi-items-table tfoot td {
    padding: 12px 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 2px solid #e2e8f0;
    font-weight: 700;
}

.pi-items-table tfoot #grandTotal {
    display: inline-block;
    min-width: 90px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.pi-section-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.pi-section-toolbar .section-desc {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.pi-section-toolbar .btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 10px 18px;
    min-height: 38px;
}

.pi-add-line-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    min-height: 52px;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
    font-size: 14px;
    font-weight: 700;
}

.pi-add-line-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.42);
}

.modal-overlay.active ~ .pi-add-line-fab,
body:has(.modal-overlay.active) .pi-add-line-fab {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .pi-add-line-fab {
        right: 16px;
        bottom: 16px;
        padding: 12px 16px;
        min-height: 46px;
    }
}

.pi-modal-confirm-text {
    white-space: nowrap;
}

.pi-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: #eef2ff;
    color: var(--primary-dark);
    white-space: nowrap;
}

.pi-type-badge--pmc { background: #eef2ff; color: #4338ca; }
.pi-type-badge--pm { background: #ecfeff; color: #0e7490; }
.pi-type-badge--pump { background: #eff6ff; color: #1d4ed8; }
.pi-type-badge--motor { background: #fffbeb; color: #b45309; }
.pi-type-badge--controller { background: #f5f3ff; color: #6d28d9; }

.pi-product-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pi-summary-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    min-width: 0;
}

.pi-summary-tag {
    flex: 0 0 auto;
    min-width: 72px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
    box-sizing: border-box;
}

.pi-summary-line--pump .pi-summary-tag { background: #dbeafe; color: #1d4ed8; }
.pi-summary-line--motor .pi-summary-tag { background: #fef3c7; color: #b45309; }
.pi-summary-line--controller .pi-summary-tag { background: #ede9fe; color: #6d28d9; }
.pi-summary-line--product .pi-summary-tag { background: #eef2ff; color: #4338ca; }

.pi-summary-text {
    flex: 1 1 auto;
    color: #334155;
    font-weight: 500;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}

.pi-display-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    white-space: nowrap;
}

.pi-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
}

.btn-icon-edit:hover {
    background: rgba(99, 102, 241, 0.1);
}

.pi-empty-row td {
    padding: 0 !important;
    border: none !important;
}

.pi-table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.pi-table-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pi-table-empty strong {
    color: #64748b;
    font-size: 14px;
}

.pi-table-empty em {
    font-style: normal;
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 1200px) {
    .pi-items-table .pi-product-slots--count-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .pi-items-table .pi-product-slots--multi {
        grid-template-columns: 1fr;
    }
}

.laser-slip-serial-hint {
    display: block;
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
}

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.form-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 28px 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 4px;
}

.text-muted {
    color: var(--gray-light);
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    padding: 12px 14px 12px 12px;
}

select.form-control {
    cursor: pointer;
    appearance: auto;
}

/* ========== DYNAMIC FIELDS ========== */

.dynamic-fields-section {
    margin-top: 8px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.section-desc {
    font-size: 13px;
    color: var(--gray);
}

.dynamic-field-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.dynamic-field-grid {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.df-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.df-col-name { flex: 1.4; }
.df-col-label { flex: 1.4; }
.df-col-type { flex: 0.9; }
.df-col-required { flex: 0.7; }
.df-col-action { flex: 0 0 40px; }

.df-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    white-space: nowrap;
}

.df-label-hidden {
    visibility: hidden;
}

.df-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.df-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.df-input[readonly] {
    background: #f1f5f9;
    color: var(--gray);
    cursor: not-allowed;
}

select.df-input {
    cursor: pointer;
    padding-right: 8px;
}

.df-remove {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.df-remove:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.df-remove svg {
    width: 16px;
    height: 16px;
}

.empty-fields-msg {
    text-align: center;
    padding: 32px 20px;
    color: var(--gray);
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: var(--radius);
    font-size: 13px;
}

.loading-fields {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 13px;
}

.field-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.field-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 11px;
    color: var(--dark-3);
}

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

/* ========== CUSTOMER FORM ========== */

.required {
    color: var(--danger);
}

.form-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 24px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section-icon {
    width: 32px;
    height: 32px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.form-section-icon svg {
    width: 18px;
    height: 18px;
}

.form-section-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.gstin-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gstin-row .form-control {
    flex: 1;
}

.gstin-row .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.pi-customer-display {
    min-height: 46px;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.pi-customer-display.is-filled {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pi-customer-display.is-missing {
    background: #fffbeb;
    border-color: #fcd34d;
}

.pi-customer-display-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.pi-customer-display-meta {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
}

.pi-customer-display-meta + .pi-customer-display-meta {
    margin-top: 2px;
}

.pi-customer-display-empty {
    font-size: 13px;
    color: #94a3b8;
}

.remarks-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--dark-3);
    line-height: 1.5;
}

.remarks-preview-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.remarks-field {
    margin-top: 16px;
    padding: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
}

.remarks-field .form-label {
    color: #92400e;
}

.remarks-cell {
    max-width: 280px;
}

.remarks-text {
    display: block;
    font-size: 13px;
    color: var(--dark-3);
    line-height: 1.5;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

/* ========== OPENING STOCK ========== */

.stock-items-section {
    margin-top: 8px;
}

.stock-serial-table-wrap {
    margin-top: 4px;
}

.stock-serial-table {
    margin-bottom: 0;
}

.stock-serial-table th,
.stock-serial-table td {
    vertical-align: middle;
}

.stock-serial-table .df-input {
    width: 100%;
    min-width: 0;
}

.stock-serial-table .stock-item-no {
    font-weight: 600;
    color: var(--gray);
}

.stock-groups-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.stock-groups-toolbar h4 {
    margin: 0 0 4px;
}

.stock-product-group {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.stock-product-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.stock-product-group-head h5 {
    margin: 0;
    font-size: 15px;
    color: var(--dark);
}

.stock-product-group-fields {
    margin-bottom: 12px;
}

.stock-group-actions {
    margin-bottom: 12px;
}

/* ========== STOCK REPORT CATEGORY BOXES ========== */

.category-stats-section {
    margin-bottom: 24px;
}

.category-stats-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.category-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.category-stat-card {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-stat-card:hover {
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.category-stat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.category-stat-total {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.category-stat-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-stat-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.category-stat-pill--ready {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.category-stat-pill--testing {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.category-stat-pill--repairing {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

.category-stat-pill--rejection {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.stock-items-header {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr;
    gap: 10px;
    padding: 0 14px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stock-item-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.stock-item-no {
    font-weight: 600;
    color: var(--gray);
    text-align: center;
}

.filter-form .filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-form .filter-grid .form-group {
    flex: 1;
    min-width: 160px;
}

.filter-form .filter-grid .btn {
    flex-shrink: 0;
}

.row-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.data-table th .row-checkbox,
.data-table td .row-checkbox {
    display: block;
    margin: 0 auto;
}

#printSelectedBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== EMPTY STATE ========== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--gray-light);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .page-content {
        padding: 20px;
    }

    .topbar {
        padding: 16px 20px;
    }

    .form-grid,
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .dynamic-field-grid {
        flex-wrap: wrap;
    }

    .df-col-name,
    .df-col-label,
    .df-col-type,
    .df-col-required {
        flex: 1 1 calc(50% - 10px);
    }

    .df-col-action {
        flex: 0 0 40px;
    }
}

/* ========== SEARCHABLE SELECT (Tom Select) ========== */

.ts-wrapper {
    width: 100%;
}

.ts-wrapper.form-control,
.ts-wrapper.single {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.ts-wrapper .ts-control {
    min-height: 42px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    box-shadow: none;
}

.ts-wrapper .ts-control:focus,
.ts-wrapper.focus .ts-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ts-wrapper .ts-control input {
    font-size: 14px;
    color: var(--dark);
}

.ts-wrapper .ts-control > input {
    min-width: 40px;
}

.ts-wrapper .ts-dropdown {
    z-index: 10050;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    margin-top: 4px;
    overflow: hidden;
}

body > .ts-dropdown,
body > .ts-dropdown.single {
    z-index: 10100 !important;
    max-height: min(300px, 45vh);
    overflow-y: auto;
    visibility: visible !important;
    opacity: 1 !important;
    background: #fff;
}

.ts-wrapper .ts-dropdown .dropdown-input {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.ts-wrapper .ts-dropdown .option {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--dark);
}

.ts-wrapper .ts-dropdown .option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

.ts-wrapper .ts-dropdown .option:hover,
.ts-wrapper .ts-dropdown .option.selected {
    background: rgba(99, 102, 241, 0.08);
}

.ts-wrapper.disabled .ts-control {
    background: #f8fafc;
    color: var(--gray);
    cursor: not-allowed;
    opacity: 1;
}

.pi-line-modal-body .ts-wrapper .ts-control,
.pi-product-slot .ts-wrapper .ts-control,
.pi-items-table .ts-wrapper .ts-control,
.laser-slip-items-table .ts-wrapper .ts-control,
.stock-item-row .ts-wrapper .ts-control,
.dynamic-field-row .ts-wrapper .ts-control {
    min-height: 38px;
    font-size: 13px;
}

.pi-line-modal-body .ts-wrapper .ts-control {
    min-height: 42px;
}

.df-input + .ts-wrapper,
select.df-input + .ts-wrapper {
    width: 100%;
}

select.df-input.ts-hidden-accessible,
select.form-control.ts-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========== TEST REPORTS ========== */

.test-report-category-block {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.test-report-category-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.test-report-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.test-report-category-head h4 {
    margin: 0;
    font-size: 16px;
    color: var(--dark);
}

.test-report-products-table {
    margin-top: 0;
}

.test-report-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-report-file-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.test-report-file-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}

.test-report-file-link:hover {
    text-decoration: underline;
}

.test-report-empty-category {
    padding: 16px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--gray);
    font-size: 13px;
}

.test-report-current-file {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.test-report-current-file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.test-report-current-file-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.test-report-file-input {
    padding: 10px 14px !important;
    cursor: pointer;
}

.test-report-file-input::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.stock-product-group-fields .ts-wrapper .ts-dropdown .dropdown-input {
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.stock-product-group-fields .ts-wrapper .ts-dropdown .dropdown-input:focus {
    box-shadow: none;
    border-bottom-color: var(--primary);
}

/* Reports hub */
.reports-hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.report-box {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.report-box:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.report-box.is-soon {
    opacity: 0.85;
}

.report-box-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.report-soon-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #92400e;
    background: #fef3c7;
    border-radius: 999px;
    padding: 3px 8px;
}

.report-box-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 6px;
}

.report-box-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.report-box-subtitle {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    min-height: 36px;
}

.report-box-cta {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.report-filters .form-control {
    min-width: 160px;
}

.report-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.report-placeholder .stat-card-icon {
    margin: 0 auto 16px;
}

.report-placeholder h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.report-placeholder p {
    margin: 0;
    color: #64748b;
}

.stat-card-icon.red {
    background: #fee2e2;
    color: #b91c1c;
}

/* User rights */
.rights-panel {
    margin-top: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    background: #f8fafc;
}

.rights-panel.is-disabled {
    opacity: 0.65;
    pointer-events: none;
}

.rights-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.rights-panel-header h4 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
}

.rights-panel-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.rights-group + .rights-group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.rights-group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
}

.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 12px;
}

.rights-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.rights-item:hover {
    border-color: var(--primary);
}

.rights-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Todos */
.todo-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.todo-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.todo-status-tab span {
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.todo-status-tab.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    color: var(--primary);
}

.todo-status-tab.active span {
    background: var(--primary);
    color: #fff;
}

.todo-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.todo-row-completed td strong {
    text-decoration: line-through;
    color: #64748b;
}

/* Manual test report form */
.tr-form-sheet {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}

.tr-form-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.tr-top-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.tr-banner {
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid #94a3b8;
    background: #f8fafc;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.tr-hp-phase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tr-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tr-product-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.tr-product-row,
.tr-motor-side-row {
    display: grid;
    gap: 6px;
    margin-bottom: 6px;
}

.tr-product-row {
    grid-template-columns: 110px 1fr 1fr 1fr;
}

.tr-motor-side-row {
    grid-template-columns: 100px 1fr;
}

.tr-product-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.tr-readings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tr-readings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.tr-readings-table th,
.tr-readings-table td {
    border: 1px solid #cbd5e1;
    padding: 4px;
    font-size: 11px;
    text-align: center;
}

.tr-readings-table th {
    background: #f1f5f9;
    font-weight: 700;
}

.tr-readings-table .tr-cell {
    padding: 4px 6px;
    font-size: 12px;
    min-width: 70px;
}

.tr-sr {
    font-weight: 700;
    width: 40px;
}

.tr-remarks {
    margin-top: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
}

.tr-remarks-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.tr-remark-line {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.tr-sign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.tr-sign-box {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    min-height: 120px;
}

.tr-sign-label {
    font-weight: 700;
    margin-bottom: 8px;
}

.tr-sign-space {
    margin-top: 28px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

@media (max-width: 900px) {
    .tr-top-grid,
    .tr-product-grid,
    .tr-sign-grid {
        grid-template-columns: 1fr;
    }

    .tr-product-row {
        grid-template-columns: 1fr;
    }
}
