/* ============================================
   DYNAMIC ORDER SYSTEM — Light Theme
   Primary: #6E9568 | Secondary: #86A6C6
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #6E9568;
    --primary-light: #8bb385;
    --primary-lighter: #e8f0e6;
    --primary-dark: #5a7d54;
    --primary-gradient: linear-gradient(135deg, #6E9568, #8bb385);
    --primary-glow: rgba(110, 149, 104, 0.25);

    --secondary: #86A6C6;
    --secondary-light: #a3bdd8;
    --secondary-lighter: #e8eff6;
    --secondary-dark: #6b8fad;

    --bg-body: #f4f6f3;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbfa;
    --bg-input: #f7f8f6;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.85);

    --text-primary: #1a2e1a;
    --text-secondary: #5a6b5a;
    --text-muted: #8a9a8a;
    --text-heading: #1a2e1a;

    --color-success: #6E9568;
    --color-warning: #d4a843;
    --color-danger: #c75f4a;
    --color-info: #86A6C6;
    --color-orange: #d08b4e;
    --color-purple: #8b7ec8;

    --border-color: #e2e8e0;
    --border-color-strong: #c8d4c6;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 4px 14px rgba(110, 149, 104, 0.25);

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

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

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Icon Sizing ---- */
.icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 22px;
    height: 22px;
}

.icon-xl {
    width: 28px;
    height: 28px;
}

.icon-2xl {
    width: 36px;
    height: 36px;
}

.icon-3xl {
    width: 48px;
    height: 48px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    background: var(--bg-body);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(110, 149, 104, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(134, 166, 198, 0.06) 0%, transparent 50%);
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.register-card {
    max-width: 560px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1.25rem;
}

.login-logo .icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    filter: drop-shadow(0 4px 12px var(--primary-glow));
    animation: pulse 2.5s infinite ease-in-out;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.link-accent {
    color: var(--primary);
    font-weight: 600;
}

.link-accent:hover {
    color: var(--primary-dark);
}

/* Floating decoration */
.login-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 25s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    right: -150px;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
    animation-delay: -8s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--primary-light);
    top: 40%;
    left: 10%;
    animation-delay: -16s;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
    flex: 1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-label .icon {
    width: 15px;
    height: 15px;
    opacity: 0.6;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #fff;
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a9a8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-inline {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

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

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.radio-label:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
}

.radio-label:has(input:checked) {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 500;
}

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

.field-unit-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-error,
.validation-errors {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.validation-errors.validation-summary-valid {
    display: none;
}

.validation-errors.validation-summary-errors {
    display: block;
    background: rgba(199, 95, 74, 0.06);
    border: 1px solid rgba(199, 95, 74, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

/* Range */
.range-container {
    padding: 0.5rem 0;
}

.range-input {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px var(--primary-glow);
    transition: transform var(--transition-fast);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.range-current {
    color: var(--primary-dark);
    font-weight: 600;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-input);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.file-upload-area.has-file {
    border-color: var(--color-success);
    background: var(--primary-lighter);
}

.file-input {
    display: none;
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.file-upload-content .icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.file-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-name {
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.85rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--primary-glow);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--primary-dark);
    background: var(--primary-lighter);
}

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

.btn-success:hover {
    background: var(--primary-dark);
    color: white;
}

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

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 0.8rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn-arrow {
    transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* ============================================
   ADMIN LAYOUT — SIDEBAR
   ============================================ */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-body);
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-logo .icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.nav-item .icon {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem;
    margin-bottom: 0.4rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 0.45rem;
    border: none;
    border-radius: var(--border-radius-sm);
    background: rgba(199, 95, 74, 0.06);
    color: var(--color-danger);
    font-family: var(--font-family);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background var(--transition-fast);
}

.btn-logout .icon {
    width: 15px;
    height: 15px;
}

.btn-logout:hover {
    background: rgba(199, 95, 74, 0.12);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-toggle .icon {
    width: 22px;
    height: 22px;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
}

.content-area {
    padding: 1.5rem 2rem;
    flex: 1;
}

/* ============================================
   CUSTOMER LAYOUT
   ============================================ */
.customer-body {
    min-height: 100vh;
    background: var(--bg-body);
}

.customer-nav {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.nav-brand .icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link .icon {
    width: 16px;
    height: 16px;
}

.nav-link:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.nav-link.active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
}

.user-name-sm {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.btn-logout-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    display: flex;
}

.btn-logout-sm .icon {
    width: 18px;
    height: 18px;
}

.btn-logout-sm:hover {
    color: var(--color-danger);
}

.customer-main {
    padding: 1.5rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-input);
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 .icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
   DASHBOARD STATS
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
}

.customer-stats {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-primary::before {
    background: var(--primary-gradient);
}

.stat-warning::before {
    background: var(--color-warning);
}

.stat-success::before {
    background: var(--color-success);
}

.stat-info::before {
    background: var(--secondary);
}

.stat-orange::before {
    background: var(--color-orange);
}

.stat-purple::before {
    background: var(--color-purple);
}

.stat-approved::before {
    background: #c9982e;
}

.stat-printready::before {
    background: #86A6C6;
}

.stat-qc::before {
    background: #9b59b6;
}

.stat-laser::before {
    background: #e74c3c;
}

.stat-shipment::before {
    background: #8b7ec8;
}

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

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

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

.stat-primary .stat-icon {
    background: var(--primary-lighter);
    color: var(--primary);
}

.stat-warning .stat-icon {
    background: rgba(212, 168, 67, 0.1);
    color: var(--color-warning);
}

.stat-success .stat-icon {
    background: var(--primary-lighter);
    color: var(--primary);
}

.stat-info .stat-icon {
    background: var(--secondary-lighter);
    color: var(--secondary-dark);
}

.stat-orange .stat-icon {
    background: rgba(208, 139, 78, 0.1);
    color: var(--color-orange);
}

.stat-purple .stat-icon {
    background: rgba(139, 126, 200, 0.1);
    color: var(--color-purple);
}

.stat-info-text {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-heading);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

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

.customer-cell {
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-weight: 500;
    color: var(--text-primary);
}

.customer-company {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar-table {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
}

/* Search & Filter */
.header-actions {
    display: flex;
    gap: 0.6rem;
}

.search-input {
    width: 220px;
}

.filter-select {
    width: 200px;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge .icon {
    width: 13px;
    height: 13px;
}

.status-badge.large {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.status-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ff9800;
}

.status-approved {
    background: rgba(255, 152, 0, 0.15);
    color: #f57c00;
}

.status-production {
    background: rgba(255, 87, 34, 0.15);
    color: #e64a19;
}

.status-ready {
    background: rgba(3, 169, 244, 0.15);
    color: #0288d1;
}

.status-qc {
    background: rgba(156, 39, 176, 0.15);
    color: #7b1fa2;
}

.status-laser {
    background: rgba(244, 67, 54, 0.15);
    color: #d32f2f;
}

.status-shipment {
    background: rgba(103, 58, 183, 0.15);
    color: #512da8;
}

.status-completed {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

/* ============================================
   STATUS TIMELINE (Admin Order Detail)
   ============================================ */
.status-timeline {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-timeline form {
    min-width: 100px;
    height: 75px;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.65rem 0.9rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.78rem;
    min-width: 85px;
    opacity: 0.65;
    filter: grayscale(20%);
}

.timeline-step .icon {
    width: 18px;
    height: 18px;
}

.timeline-step:hover {
    opacity: 0.9;
    filter: grayscale(0%);
    transform: translateY(-2px);
}

.timeline-step.active {
    font-weight: 700;
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.08);
    z-index: 2;
    color: white !important;
}

.timeline-step.active .step-text,
.timeline-step.active .step-icon,
.timeline-step.active .icon {
    color: white !important;
}

.timeline-step.status-pending.active {
    background: #f57c00 !important;
    border-color: #e65100;
}

.timeline-step.status-approved.active {
    background: #e65100 !important;
    border-color: #bf360c;
}

.timeline-step.status-production.active {
    background: #d84315 !important;
    border-color: #bf360c;
}

.timeline-step.status-ready.active {
    background: #0277bd !important;
    border-color: #01579b;
}

.timeline-step.status-qc.active {
    background: #6a1b9a !important;
    border-color: #4a148c;
}

.timeline-step.status-laser.active {
    background: #c62828 !important;
    border-color: #b71c1c;
}

.timeline-step.status-shipment.active {
    background: #4527a0 !important;
    border-color: #311b92;
}

.timeline-step.status-completed.active {
    background: #2e7d32 !important;
    border-color: #1b5e20;
}

.timeline-step.done {
    opacity: 0.9;
    filter: grayscale(0%);
}

.step-icon {
    font-size: 1.1rem;
}

.step-text {
    font-size: 0.72rem;
}

/* ============================================
   ORDER PROGRESS (Customer Detail)
   ============================================ */
.order-status-progress {
    padding: 1.5rem 0;
}

.progress-track {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-track::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.step-dot .icon {
    width: 16px;
    height: 16px;
}

.progress-step.completed .step-dot {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary);
}

.progress-step.current .step-dot {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    animation: pulse 2s infinite;
}

.step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.progress-step.completed .step-label {
    color: var(--primary);
}

.progress-step.current .step-label {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ============================================
   DETAIL & INFO GRID
   ============================================ */
.detail-header {
    margin-bottom: 1.25rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.field-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 600px;
}

.field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.field-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.field-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.field-unit {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

/* ============================================
   FORM BUILDER
   ============================================ */
.form-builder-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-heading);
}

.section-header h3 .icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.field-builder-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.6rem;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.field-builder-item:hover {
    border-color: var(--border-color-strong);
}

.field-builder-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.field-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
}

.field-drag-handle .icon {
    width: 16px;
    height: 16px;
}

.field-number {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--border-color);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.field-builder-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.field-builder-actions {
    display: flex;
    gap: 0.2rem;
}

.field-builder-body {
    padding: 0.9rem;
}

.field-builder-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.condition-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.condition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: var(--secondary-lighter);
    border-bottom: 1px solid var(--border-color);
}

.condition-number {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary-dark);
}

.condition-body {
    padding: 0.9rem;
}

.form-builder-actions {
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   FORM CARDS GRID
   ============================================ */
.form-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.9rem;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.15rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.form-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.form-card-image {
    width: calc(100% + 2.3rem);
    height: 120px;
    margin: -1.15rem -1.15rem 0.85rem -1.15rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-input);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-card-image .icon {
    opacity: 0.2;
    width: 48px;
    height: 48px;
}

.form-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.form-card:hover .form-card-image img {
    transform: scale(1.05);
}

.form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.form-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
}

.form-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    line-height: 1.5;
}

.form-card-meta {
    display: flex;
    gap: 0.9rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
    align-items: center;
}

.form-card-meta .icon {
    width: 13px;
    height: 13px;
}

.form-card-actions {
    display: flex;
    gap: 0.4rem;
}

/* ============================================
   CUSTOMER: Welcome, Order Cards
   ============================================ */
.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xs);
    background-image:
        radial-gradient(ellipse at 90% 50%, rgba(110, 149, 104, 0.05) 0%, transparent 60%);
}

.welcome-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.accent {
    color: var(--primary);
}

.order-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.9rem;
}

.order-card-link {
    text-decoration: none;
    color: inherit;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.9rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.order-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.order-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.order-id {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-heading);
}

.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-form-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.order-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================
   PAGE HEADER & MISC
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h1 .icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

.order-form .card {
    margin-bottom: 0.9rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Alerts */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.9rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

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

.alert-success {
    background: var(--primary-lighter);
    border: 1px solid rgba(110, 149, 104, 0.25);
    color: var(--primary-dark);
}

.alert-danger {
    background: rgba(199, 95, 74, 0.06);
    border: 1px solid rgba(199, 95, 74, 0.2);
    color: var(--color-danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-muted);
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.6rem;
    opacity: 0.3;
}

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

/* Utility */
.mt-2 {
    margin-top: 0.65rem;
}

.mt-4 {
    margin-top: 1.25rem;
}

/* ============================================
   FORM BUILDER — Drag & Drop
   ============================================ */
.fb {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 0;
    min-height: calc(100vh - 120px);
    margin: -1.5rem -2rem 0;
    border-top: 1px solid var(--border-color);
}

/* --- Palette (Left) --- */
.fb-palette {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.fb-palette-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fb-palette-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-heading);
}

.fb-palette-header h3 .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.fb-palette-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.fb-palette-list {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fb-palette-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: grab;
    transition: all var(--transition-fast);
    user-select: none;
}

.fb-palette-item .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    opacity: 0.7;
}

.fb-palette-item:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border-color: var(--border-color);
}

.fb-palette-item.dragging {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--primary);
}

.fb-palette-item:active {
    cursor: grabbing;
}

.fb-palette-section {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.fb-palette-section h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.fb-palette-section h4 .icon {
    color: var(--secondary-dark);
}

/* --- Canvas (Center) --- */
.fb-canvas {
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}

.fb-canvas-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.fb-form-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex: 1;
}

.fb-form-image-container {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-lg);
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all var(--transition-base);
    flex-shrink: 0;
    margin-top: 2px;
}

.fb-form-image-container:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.fb-form-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fb-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.6rem;
    text-align: center;
}

.fb-image-placeholder .icon {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    opacity: 0.5;
}

.fb-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: white;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--color-danger);
    box-shadow: var(--shadow-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border: 1px solid var(--border-color);
    padding: 0;
}

.fb-form-image-container:hover .fb-image-remove {
    opacity: 1;
}

.fb-form-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1px;
}

.fb-form-name {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    font-family: var(--font-family);
    outline: none;
    padding: 0.2rem 0;
}

.fb-form-name::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.fb-form-desc {
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-family);
    outline: none;
    padding: 0;
}

.fb-form-desc::placeholder {
    color: var(--text-muted);
}

.fb-canvas-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Toggle */
.fb-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.fb-toggle input {
    display: none;
}

.fb-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--border-color-strong);
    border-radius: 10px;
    position: relative;
    transition: background var(--transition-fast);
}

.fb-toggle-slider::after {
    content: '';
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.fb-toggle input:checked+.fb-toggle-slider {
    background: var(--primary);
}

.fb-toggle input:checked+.fb-toggle-slider::after {
    transform: translateX(16px);
}

.fb-toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Canvas area */
.fb-canvas-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.fb-drop-zone {
    max-width: 640px;
    margin: 0 auto;
    min-height: 300px;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
}

.fb-drop-zone.fb-drop-active {
    background: var(--primary-lighter);
    border: 2px dashed var(--primary);
    padding: 0.5rem;
}

.fb-drop-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
}

.fb-drop-placeholder .icon {
    color: var(--primary);
    opacity: 0.3;
    margin-bottom: 0.75rem;
}

.fb-drop-placeholder h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.fb-drop-placeholder p {
    font-size: 0.82rem;
}

/* --- Field Cards --- */
.fb-field-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: stretch;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.fb-field-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.fb-field-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-sm);
}

.fb-field-card.fb-field-ghost {
    opacity: 0.4;
    border-style: dashed;
}

.fb-field-card.fb-field-chosen {
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.fb-field-grip {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    cursor: grab;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity var(--transition-fast);
    border-right: 1px solid var(--border-color);
    background: var(--bg-input);
}

.fb-field-grip:active {
    cursor: grabbing;
}

.fb-field-card:hover .fb-field-grip {
    opacity: 0.8;
}

.fb-field-grip .icon {
    width: 14px;
    height: 14px;
}

.fb-field-preview {
    flex: 1;
    padding: 0.85rem 1rem;
    min-width: 0;
}

.fb-field-label-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.fb-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-heading);
}

.fb-required {
    color: var(--color-danger);
    font-weight: 700;
}

.fb-field-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
    border-left: 1px solid var(--border-color);
    background: var(--bg-input);
}

.fb-field-badge .icon {
    opacity: 0.5;
}

.fb-field-actions {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.fb-field-action {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.fb-field-action:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.fb-field-action-danger:hover {
    background: rgba(199, 95, 74, 0.06);
    color: var(--color-danger);
}

.fb-field-action+.fb-field-action {
    border-top: 1px solid var(--border-color);
}

/* --- Field Previews --- */
.fb-preview-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fb-preview-input .icon {
    opacity: 0.3;
}

.fb-preview-placeholder {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.fb-preview-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    height: 48px;
}

.fb-preview-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.fb-preview-select .icon {
    opacity: 0.4;
}

.fb-preview-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.fb-preview-radio label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
}

.fb-radio-dot {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color-strong);
    border-radius: 50%;
    flex-shrink: 0;
}

.fb-preview-more {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.fb-preview-file {
    border: 1.5px dashed var(--border-color);
    border-radius: 6px;
    padding: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.fb-preview-file .icon {
    width: 16px;
    height: 16px;
}

.fb-preview-range .fb-range-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    position: relative;
    margin-bottom: 0.25rem;
}

.fb-range-fill {
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 3px;
}

.fb-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    top: -4px;
    left: 38%;
    box-shadow: 0 1px 3px var(--primary-glow);
}

.fb-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.fb-preview-number {
    justify-content: space-between;
}

.fb-number-btns {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fb-number-btns .icon {
    opacity: 0.3;
    width: 12px;
    height: 12px;
}

.fb-preview-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.fb-check-box {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color-strong);
    border-radius: 3px;
    flex-shrink: 0;
}

/* --- Properties Panel (Right) --- */
.fb-props {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.fb-props-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}

.fb-props-empty .icon {
    opacity: 0.2;
}

.fb-props-empty p {
    font-size: 0.82rem;
}

.fb-props-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fb-props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-input);
}

.fb-props-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-heading);
}

.fb-props-header h3 .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.fb-props-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.fb-props-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.fb-prop-group {
    margin-bottom: 0.9rem;
}

.fb-prop-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fb-prop-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.fb-prop-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

.fb-prop-toggle input {
    display: none;
}

/* Options editor */
.fb-options-editor {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.fb-option-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.fb-option-item .form-input {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

/* Conditions */
.fb-conditions-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fb-conditions-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0;
}

.fb-condition-chip {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    font-size: 0.72rem;
}

.fb-condition-chip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.fb-condition-num {
    font-weight: 700;
    color: var(--secondary-dark);
    font-size: 0.7rem;
}

.fb-condition-fields {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.fb-condition-fields .form-input {
    padding: 0.25rem 0.4rem;
    min-width: 0;
}

.fb-condition-eq {
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.fb-condition-arrow {
    text-align: center;
    color: var(--primary);
    padding: 0.1rem 0;
}

/* Responsive */
@media (max-width: 960px) {
    .fb {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .fb-palette {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-x: auto;
    }

    .fb-palette-list {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .fb-palette-section {
        display: none;
    }

    .fb-props {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 200;
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        transition: transform var(--transition-base);
    }

    .fb-props.open {
        transform: translateX(0);
    }
}

/* ============================================
   CHARTS
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0.9rem;
}

.chart-card {
    overflow: visible;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container-doughnut {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 3px;
}

.chart-tab {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-tab:hover {
    color: var(--text-primary);
}

.chart-tab.active {
    background: var(--bg-card);
    color: var(--primary-dark);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

@media (max-width: 960px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(20px, -20px) rotate(3deg);
    }

    50% {
        transform: translate(-15px, 15px) rotate(-3deg);
    }

    75% {
        transform: translate(10px, -10px) rotate(2deg);
    }
}

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

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .content-area {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .customer-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

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

    .nav-links {
        display: none;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.9rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .progress-track {
        flex-direction: column;
        gap: 0.6rem;
    }

    .progress-track::before {
        display: none;
    }

    .progress-step {
        flex-direction: row;
        gap: 0.6rem;
    }

    .status-timeline {
        flex-direction: column;
    }

    .timeline-step {
        flex-direction: row;
    }

    .header-actions {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .dashboard-grid,
    .customer-stats {
        grid-template-columns: 1fr;
    }

    .order-cards {
        grid-template-columns: 1fr;
    }

    .form-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Order Create Layout */
.order-create-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2.5rem;
}

.order-form-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.5rem;
    height: fit-content;
}

.order-form-image {
    width: 100%;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.order-form-image img {
    width: 100%;
    height: auto;
    display: block;
}

.order-form-description {
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.order-form-description h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-form-description h4 .icon {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.order-form-description p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

@media (max-width: 1024px) {
    .order-create-layout {
        grid-template-columns: 1fr;
    }

    .order-form-info {
        order: -1;
        position: static;
    }
}