/* =====================================================
   SAM Travel Invoice Manager — Modern Design System
   يُستخدم في wp-admin والـ Frontend Portal معًا.
   ===================================================== */

:root {
  --sam-primary: #0d9488;
  --sam-primary-600: #0f766e;
  --sam-primary-700: #115e59;
  --sam-primary-50: #ecfdf5;
  --sam-accent: #f59e0b;
  --sam-success: #10b981;
  --sam-warning: #f59e0b;
  --sam-danger: #ef4444;
  --sam-info: #3b82f6;
  --sam-indigo: #6366f1;
  --sam-purple: #a855f7;
  --sam-bg: #f6f8fb;
  --sam-bg-soft: #f1f5f9;
  --sam-card-bg: #ffffff;
  --sam-border: #e2e8f0;
  --sam-border-soft: #eef2f7;
  --sam-text: #0f172a;
  --sam-text-soft: #475569;
  --sam-text-muted: #64748b;
  --sam-radius-sm: 8px;
  --sam-radius: 14px;
  --sam-radius-lg: 18px;
  --sam-shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --sam-shadow: 0 4px 12px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --sam-shadow-lg: 0 12px 32px -8px rgba(15,23,42,.18), 0 4px 12px rgba(15,23,42,.06);
  --sam-transition: 180ms cubic-bezier(.4,.0,.2,1);
}

/* ===== Base ===== */
.samtim-wrap{max-width:1400px;margin:20px auto 40px;color:var(--sam-text)}
.samtim-wrap *{box-sizing:border-box}
/* لا letter-spacing على العناوين — العربية خط متّصل ويفصلها التباعد. */
.samtim-wrap h1,.samtim-wrap h2,.samtim-wrap h3,.samtim-wrap h4{color:var(--sam-text)}
.samtim-wrap h1{font-size:26px;font-weight:700;margin:0}
.samtim-wrap a{color:var(--sam-primary-600);text-decoration:none;transition:color var(--sam-transition)}
.samtim-wrap a:hover{color:var(--sam-primary-700)}

/* ===== wp-admin page background (portal-like) ===== */
body[class*="_sam-tim-"] #wpcontent,
body[class*="_page_sam-tim"] #wpcontent,
body.toplevel_page_sam-tim-dashboard #wpcontent{
  background:var(--sam-bg);
  padding-inline-start:0;
}
body[class*="_sam-tim-"] #wpbody-content,
body[class*="_page_sam-tim"] #wpbody-content,
body.toplevel_page_sam-tim-dashboard #wpbody-content{
  padding-bottom:60px;
}
body[class*="_sam-tim-"] #wpfooter,
body[class*="_page_sam-tim"] #wpfooter,
body.toplevel_page_sam-tim-dashboard #wpfooter{
  background:transparent;color:var(--sam-text-muted)
}
body[class*="_sam-tim-"] #wpcontent > *,
body[class*="_page_sam-tim"] #wpcontent > *{
  padding-inline-start:20px;padding-inline-end:20px;
}

/* ===== Portal-style welcome banner (admin + portal) ===== */
.samtim-card.samtim-welcome{position:relative;overflow:hidden;background:linear-gradient(135deg,var(--sam-primary) 0%,var(--sam-primary-700) 100%);color:#fff !important;border:none !important;border-radius:var(--sam-radius-lg);padding:26px 28px;margin-bottom:18px;box-shadow:0 12px 32px -10px rgba(13,148,136,.5)}
.samtim-card.samtim-welcome::before{content:"";position:absolute;top:-40%;right:-10%;width:280px;height:280px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.18) 0%,transparent 70%);pointer-events:none}
.samtim-card.samtim-welcome::after{content:"";position:absolute;bottom:-50%;left:-5%;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.1) 0%,transparent 70%);pointer-events:none}
.samtim-card.samtim-welcome h2{color:#fff !important;margin:0 0 6px;font-size:22px;font-weight:700;position:relative;z-index:1}
.samtim-card.samtim-welcome p{color:rgba(255,255,255,.88) !important;margin:0;font-size:14px;position:relative;z-index:1;line-height:1.7}
.samtim-card.samtim-welcome .samtim-welcome-actions{display:flex;gap:10px;margin-top:14px;position:relative;z-index:1;flex-wrap:wrap}
.samtim-card.samtim-welcome .samtim-welcome-actions .button{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.3);color:#fff;backdrop-filter:blur(4px)}
.samtim-card.samtim-welcome .samtim-welcome-actions .button:hover{background:rgba(255,255,255,.28);border-color:rgba(255,255,255,.5);color:#fff}
.samtim-card.samtim-welcome .samtim-welcome-actions .button-primary{background:#fff;color:var(--sam-primary-700);border-color:#fff}
.samtim-card.samtim-welcome .samtim-welcome-actions .button-primary:hover{background:#f0fdfa;color:var(--sam-primary-700);box-shadow:0 4px 14px rgba(0,0,0,.15)}

/* ===== Tabs ===== */
.sam-tabs-nav{display:flex;flex-wrap:wrap;gap:4px;padding:6px;background:var(--sam-bg-soft);border-radius:12px;margin-bottom:14px;border:1px solid var(--sam-border-soft)}
.sam-tabs-nav .sam-tab{flex:1 1 auto;min-width:0;padding:9px 12px;border:none;background:transparent;color:var(--sam-text-soft);font-size:13px;font-weight:600;border-radius:8px;cursor:pointer;transition:all var(--sam-transition);font-family:inherit;display:inline-flex;align-items:center;justify-content:center;gap:6px;text-align:center;white-space:nowrap}
.sam-tabs-nav .sam-tab:hover{color:var(--sam-text);background:rgba(255,255,255,.6)}
.sam-tabs-nav .sam-tab.is-active{background:#fff;color:var(--sam-primary-700);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.sam-tabs-nav .sam-tab .dashicons{font-size:14px;width:14px;height:14px}
.sam-tab-panel{display:none;animation:samFadeIn .25s ease-out}
.sam-tab-panel.is-active{display:block}

/* ===== Fullscreen floating button (fixed bottom-left, icon only) ===== */
.sam-fullscreen-btn{
  position:fixed !important;
  bottom:24px !important;
  left:24px !important;
  width:48px !important;
  height:48px !important;
  padding:0 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:0 !important;
  border:1px solid var(--sam-border) !important;
  background:#fff !important;
  color:var(--sam-primary-700) !important;
  border-radius:50% !important;
  cursor:pointer !important;
  font-family:inherit !important;
  text-decoration:none !important;
  box-shadow:0 6px 20px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.08) !important;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease !important;
  z-index:99999 !important;
  line-height:1 !important;
}
.sam-fullscreen-btn:hover{
  background:var(--sam-primary) !important;
  color:#fff !important;
  border-color:var(--sam-primary) !important;
  transform:translateY(-2px) !important;
  box-shadow:0 10px 26px rgba(13,148,136,.35), 0 4px 10px rgba(15,23,42,.12) !important;
}
.sam-fullscreen-btn:focus{outline:none !important;box-shadow:0 0 0 3px rgba(13,148,136,.25), 0 6px 20px rgba(15,23,42,.18) !important}
.sam-fullscreen-btn .dashicons{font-size:22px !important;width:22px !important;height:22px !important;margin:0 !important}
/* hide any text labels (icon only) */
.sam-fullscreen-btn .label-enter,
.sam-fullscreen-btn .label-exit{display:none !important}
/* swap icon when in fullscreen */
.sam-fullscreen-btn .dashicons-exit-fs{display:none !important}
body.sam-fullscreen .sam-fullscreen-btn .dashicons-enter-fs{display:none !important}
body.sam-fullscreen .sam-fullscreen-btn .dashicons-exit-fs{display:inline-block !important}
/* keep above WP admin bar and any sticky footer */
body.sam-fullscreen .sam-fullscreen-btn{bottom:24px !important;left:24px !important}
@media (max-width:600px){
  .sam-fullscreen-btn{width:44px !important;height:44px !important;bottom:16px !important;left:16px !important}
  .sam-fullscreen-btn .dashicons{font-size:20px !important;width:20px !important;height:20px !important}
}

/* admin fullscreen — hide WP chrome */
body.sam-fullscreen #wpadminbar{display:none !important}
body.sam-fullscreen #adminmenumain{display:none !important}
body.sam-fullscreen html{margin-top:0 !important}
body.sam-fullscreen #wpcontent{margin-inline-start:0 !important;padding-top:0 !important}
body.sam-fullscreen #wpbody-content{padding-top:10px !important}
body.sam-fullscreen #wpfooter{display:none !important}
body.sam-fullscreen .samtim-wrap{max-width:1600px;padding:0 16px}

/* frontend fullscreen — hide theme chrome (best-effort) */
body.sam-fullscreen header,body.sam-fullscreen footer,body.sam-fullscreen .site-header,body.sam-fullscreen .site-footer,body.sam-fullscreen #masthead,body.sam-fullscreen #colophon,body.sam-fullscreen nav.main-navigation,body.sam-fullscreen aside,body.sam-fullscreen #secondary,body.sam-fullscreen .widget-area,body.sam-fullscreen .entry-header,body.sam-fullscreen .entry-meta,body.sam-fullscreen .entry-footer{display:none !important}
body.sam-fullscreen .entry-content,body.sam-fullscreen .site-main,body.sam-fullscreen .site-content,body.sam-fullscreen main{max-width:none !important;padding:0 !important;margin:0 !important;width:100% !important}
body.sam-fullscreen .samtim-frontend{max-width:1600px;margin:10px auto;padding:0 16px}

/* ===== Customer picker (autocomplete) ===== */
.samtim-customer-picker{position:relative;background:linear-gradient(135deg,#f0fdfa 0%,#ecfdf5 100%);border:1px dashed var(--sam-primary);border-radius:var(--sam-radius);padding:14px;margin-bottom:14px}
.samtim-customer-picker > label{font-weight:700;color:var(--sam-primary-700);margin-bottom:8px;display:block;font-size:13px}
.samtim-customer-picker .description{font-size:11.5px;color:var(--sam-text-muted);margin:8px 0 0;line-height:1.6}
.sam-customer-search-wrap{position:relative}
.sam-customer-search{width:100%;height:38px;padding:6px 12px;border:1px solid var(--sam-border);border-radius:8px;background:#fff;font-family:inherit;font-size:13.5px;direction:rtl}
.sam-customer-search:focus{outline:none;border-color:var(--sam-primary);box-shadow:0 0 0 3px rgba(13,148,136,.15)}
.sam-customer-results{position:absolute;z-index:50;top:calc(100% + 4px);left:0;right:0;max-height:280px;overflow-y:auto;background:#fff;border:1px solid var(--sam-border);border-radius:10px;box-shadow:0 10px 30px -8px rgba(15,23,42,.18);padding:4px}
.sam-customer-results[hidden]{display:none}
.sam-cust-row{display:flex;flex-direction:column;gap:2px;padding:8px 12px;border-radius:6px;cursor:pointer;transition:background var(--sam-transition)}
.sam-cust-row:hover{background:var(--sam-primary-50)}
.sam-cust-row strong{font-size:13.5px;color:var(--sam-text)}
.sam-cust-row span{font-size:12px;color:var(--sam-text-muted)}
.sam-cust-empty{padding:14px;text-align:center;color:var(--sam-text-muted);font-size:12.5px}
.sam-customer-selected{margin-top:10px;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;background:#fff;border:1px solid var(--sam-border-soft);border-radius:8px;padding:10px 12px}
.sam-customer-selected[hidden]{display:none}
.sam-customer-selected .sel-info{display:flex;flex-direction:column;gap:2px;flex:1}
.sam-customer-selected .sel-name{font-size:14px;color:var(--sam-text)}
.sam-customer-selected .sel-meta{font-size:12.5px;color:var(--sam-text-muted)}
.sam-customer-selected .sel-badge{display:inline-block;margin-top:4px;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:999px;background:var(--sam-primary-50);color:var(--sam-primary-700);width:fit-content}
.sam-customer-selected .sel-badge.new{background:#fef3c7;color:#92400e}
.sam-clear-customer{background:transparent;border:none;color:var(--sam-text-muted);font-size:22px;line-height:1;cursor:pointer;padding:0 6px;border-radius:6px;transition:color var(--sam-transition),background var(--sam-transition)}
.sam-clear-customer:hover{color:#dc2626;background:#fef2f2}

/* ===== Sticky form footer (Save button) ===== */
.samtim-form-footer{
  position:sticky;bottom:0;
  display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap;
  padding:14px 20px;
  background:rgba(255,255,255,.96);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  border:1px solid var(--sam-border);
  border-radius:var(--sam-radius-lg);
  margin-top:18px;
  z-index:30;
  box-shadow:0 -6px 16px -4px rgba(15,23,42,.08);
}
.samtim-form-footer .footer-spacer{flex:1}
.samtim-form-footer .footer-info{font-size:12.5px;color:var(--sam-text-muted)}
.samtim-form-footer .button-primary{min-width:140px}
/* In invoice form (grid layout), footer spans full width */
.samtim-invoice-layout .samtim-form-footer{grid-column:1/-1}
/* Compact invoice layout - fit screen */
.samtim-invoice-layout{align-items:start}
.samtim-invoice-layout .samtim-sidebar{max-height:calc(100vh - 180px);overflow-y:auto;padding-inline-end:6px}
.samtim-invoice-layout .sticky-preview{max-height:calc(100vh - 100px);overflow-y:auto}
.samtim-invoice-layout .sticky-preview::-webkit-scrollbar,.samtim-invoice-layout .samtim-sidebar::-webkit-scrollbar{width:6px}
.samtim-invoice-layout .sticky-preview::-webkit-scrollbar-thumb,.samtim-invoice-layout .samtim-sidebar::-webkit-scrollbar-thumb{background:var(--sam-border);border-radius:6px}
body.sam-fullscreen .samtim-invoice-layout .samtim-sidebar,body.sam-fullscreen .samtim-invoice-layout .sticky-preview{max-height:calc(100vh - 130px)}

/* ===== Simple bar chart for Stats page ===== */
.sam-chart-bars,.sam-stats-list{display:flex;flex-direction:column;gap:14px}
.sam-bar-row,.sam-stat-row{display:flex;align-items:center;gap:12px}
.sam-bar-label,.sam-stat-label{min-width:90px;flex-shrink:0;font-size:13px;color:var(--sam-text-soft);font-weight:600}
.sam-bar-track{flex:1;height:10px;background:var(--sam-bg-soft);border-radius:999px;overflow:hidden;position:relative}
.sam-bar-fill{height:100%;background:linear-gradient(90deg,var(--sam-primary) 0%,var(--sam-primary-700) 100%);border-radius:999px;transition:width 600ms cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px rgba(13,148,136,.3)}
.sam-bar-value{min-width:120px;text-align:left;font-size:13px;color:var(--sam-text);font-weight:700;font-variant-numeric:tabular-nums;direction:ltr;flex-shrink:0}
.sam-stat-row .sam-badge{min-width:120px;flex-shrink:0;justify-content:center}

/* ===== Header ===== */
.samtim-header{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:20px;flex-wrap:wrap;animation:samFadeIn .3s ease-out}
.samtim-header h1{display:flex;align-items:center;gap:12px}
.samtim-header h1::before{content:"";display:inline-block;width:6px;height:28px;background:linear-gradient(180deg,var(--sam-primary) 0%,var(--sam-primary-700) 100%);border-radius:6px;box-shadow:0 2px 6px rgba(13,148,136,.4)}
.samtim-header .button{flex-shrink:0}
@keyframes samFadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.samtim-card,.samtim-table-wrap,.samtim-table-toolbar{animation:samFadeIn .35s ease-out}

/* ===== Grid ===== */
.samtim-grid{display:grid;gap:18px}
.cards-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cards-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.cards-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.mt-24{margin-top:24px}
.mt-16{margin-top:16px}

/* ===== Cards ===== */
.samtim-card{background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:var(--sam-radius-lg);padding:20px;box-shadow:var(--sam-shadow-sm);transition:box-shadow var(--sam-transition),transform var(--sam-transition)}
.samtim-card h2,.samtim-card h3,.samtim-card h4{margin:0 0 14px}
.samtim-card h3{font-size:16px;font-weight:700;padding-bottom:12px;border-bottom:1px solid var(--sam-border-soft);display:flex;align-items:center;gap:8px}
.samtim-card h3::before{content:"";width:4px;height:18px;background:var(--sam-primary);border-radius:4px}
.samtim-card.muted{background:var(--sam-bg-soft)}
.samtim-card.no-pad{padding:0}
.samtim-card.no-pad .samtim-table-toolbar,.samtim-card.no-pad .samtim-table{margin:0}

/* ===== Stat cards (Dashboard) ===== */
.samtim-card.stat{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:8px;padding:22px;background:linear-gradient(135deg,#ffffff 0%,#f8fafc 100%)}
.samtim-card.stat::before{content:"";position:absolute;top:-30px;left:-30px;width:120px;height:120px;background:linear-gradient(135deg,var(--sam-primary) 0%,var(--sam-primary-700) 100%);opacity:.08;border-radius:50%}
.samtim-card.stat strong{font-size:34px;line-height:1;font-weight:800;color:var(--sam-primary-600);position:relative;z-index:1}
.samtim-card.stat span{color:var(--sam-text-muted);font-size:14px;font-weight:500;position:relative;z-index:1}
.samtim-card.stat.accent::before{background:linear-gradient(135deg,var(--sam-accent) 0%,#d97706 100%)}
.samtim-card.stat.accent strong{color:#d97706}
.samtim-card.stat.success::before{background:linear-gradient(135deg,var(--sam-success) 0%,#059669 100%)}
.samtim-card.stat.success strong{color:#059669}
.samtim-card.stat.info::before{background:linear-gradient(135deg,var(--sam-info) 0%,#2563eb 100%)}
.samtim-card.stat.info strong{color:#2563eb}
/* شارة التغيّر عن الفترة السابقة داخل بطاقة إحصاء */
.samtim-card.stat .sam-delta{display:inline-block;margin-inline-start:6px;font-style:normal;font-size:12px;font-weight:700;padding:2px 7px;border-radius:20px;direction:ltr}
.samtim-card.stat .sam-delta.up{background:#ecfdf5;color:#047857}
.samtim-card.stat .sam-delta.down{background:#fef2f2;color:#b91c1c}

/* ===== Buttons ===== */
.samtim-wrap .button,.samtim-frontend .button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 18px;border-radius:10px;border:1px solid var(--sam-border);background:#fff;color:var(--sam-text);font-size:14px;font-weight:600;cursor:pointer;text-decoration:none;line-height:1.2;transition:all var(--sam-transition);box-shadow:var(--sam-shadow-sm)}
.samtim-wrap .button:hover,.samtim-frontend .button:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px);box-shadow:var(--sam-shadow)}
.samtim-wrap .button-primary,.samtim-frontend .button-primary{background:linear-gradient(135deg,var(--sam-primary) 0%,var(--sam-primary-600) 100%);border-color:var(--sam-primary-600);color:#fff;box-shadow:0 2px 8px rgba(13,148,136,.25)}
.samtim-wrap .button-primary:hover,.samtim-frontend .button-primary:hover{background:linear-gradient(135deg,var(--sam-primary-600) 0%,var(--sam-primary-700) 100%);color:#fff;border-color:var(--sam-primary-700);box-shadow:0 4px 14px rgba(13,148,136,.35)}
.samtim-wrap .button-large,.samtim-frontend .button-large{padding:12px 26px;font-size:15px}
.samtim-wrap .button-danger,.samtim-frontend .button-danger{background:#fff;border-color:#fecaca;color:var(--sam-danger)}
.samtim-wrap .button-danger:hover,.samtim-frontend .button-danger:hover{background:#fef2f2;border-color:#f87171}
.samtim-wrap .button .dashicons,.samtim-frontend .button .dashicons{font-size:16px;width:16px;height:16px;line-height:1}

/* Icon-only action buttons (invoice preview toolbar — أدمن + فرونت) */
.samtim-wrap .sam-icon-btn,.samtim-frontend .sam-icon-btn{width:40px;min-width:40px;height:40px;padding:0;justify-content:center;flex-shrink:0;gap:0}
.samtim-wrap .sam-icon-btn .dashicons,.samtim-frontend .sam-icon-btn .dashicons{margin:0;font-size:18px;width:18px;height:18px}
.samtim-wrap .sam-icon-btn svg,.samtim-frontend .sam-icon-btn svg{margin:0 !important}
.sam-icon-btn .sam-btn-txt{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.invoice-actions-group form{display:inline-flex}

/* ===== Forms ===== */
.samtim-form .samtim-field{margin-bottom:16px}
.samtim-field label{display:block;font-weight:600;margin-bottom:6px;color:var(--sam-text-soft);font-size:13px}
.samtim-field input[type="text"],.samtim-field input[type="email"],.samtim-field input[type="url"],.samtim-field input[type="number"],.samtim-field input[type="date"],.samtim-field input[type="password"],.samtim-field input[type="color"],.samtim-field select,.samtim-field textarea{width:100%;padding:10px 14px;border:1px solid var(--sam-border);border-radius:10px;box-sizing:border-box;background:#fff;color:var(--sam-text);font-size:14px;font-family:inherit;transition:border-color var(--sam-transition),box-shadow var(--sam-transition);line-height:1.5}
.samtim-field input:focus,.samtim-field select:focus,.samtim-field textarea:focus{outline:none;border-color:var(--sam-primary);box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.samtim-field input[readonly]{background:var(--sam-bg-soft);color:var(--sam-text-muted);cursor:not-allowed}
.samtim-field input[type="color"]{height:42px;padding:4px;cursor:pointer}
.samtim-field textarea{min-height:110px;resize:vertical}
.samtim-field select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2364748b' d='M6 8.5L1.5 4h9z'/></svg>");background-repeat:no-repeat;background-position:left 12px center;padding-left:36px}
.samtim-field input::placeholder,.samtim-field textarea::placeholder{color:#94a3b8}
.media-picker{display:flex;gap:8px}
.media-picker input{flex:1}
.thumb-preview img{max-width:100%;height:90px;object-fit:cover;border-radius:12px;margin-top:10px;border:1px solid var(--sam-border)}

/* ===== Settings layout (بطاقات في أعمدة + حقول مضغوطة) ===== */
/* كل بطاقة = جزئية واحدة. الأعمدة تنهار تلقائيًا حسب العرض المتاح. */
.samtim-settings-grid{
  display:grid;gap:18px;align-items:start;
  grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
}
.samtim-settings-grid > .samtim-card{margin:0;height:100%}
/* بطاقة تمتد على كامل الصف (نصوص طويلة / شبكات checkbox) */
.samtim-settings-grid > .samtim-card.span-all{grid-column:1/-1}

/* صف حقول جنبًا إلى جنب داخل البطاقة — بدل صف كامل لكل حقل */
.samtim-field-row{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.samtim-field-row.wide{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.samtim-form .samtim-field-row{margin-bottom:16px}
.samtim-form .samtim-field-row .samtim-field{margin-bottom:0}

/* نص مساعد موحّد (بديل الـ inline styles) */
.samtim-help{margin:6px 0 0;color:var(--sam-text-muted);font-size:12.5px;line-height:1.65}
.samtim-help code{background:var(--sam-bg-soft);padding:1px 5px;border-radius:5px;font-size:12px}
.samtim-card > h3 + .samtim-help{margin:0 0 14px}

/* Checkbox كصفّ قابل للنقر بدل label عائم */
.samtim-field .samtim-check,
.samtim-check{
  display:flex;align-items:center;gap:10px;margin:0;
  padding:11px 14px;border:1px solid var(--sam-border);border-radius:10px;
  background:var(--sam-bg-soft);cursor:pointer;
  font-size:13.5px;font-weight:500;color:var(--sam-text);line-height:1.4;
  transition:border-color var(--sam-transition),background var(--sam-transition);
}
.samtim-field .samtim-check:hover,
.samtim-check:hover{border-color:var(--sam-primary);background:rgba(13,148,136,.06)}
.samtim-check input[type="checkbox"]{margin:0;flex-shrink:0}
.samtim-check-grid{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}

/* حقل اللون: مربّع لون مضغوط بدل عنصر بعرض الصف */
.samtim-field.color-field input[type="color"]{width:100%;max-width:120px}

/* بطاقات معاينة قوالب الطباعة */
.sam-tpl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin-top:14px}
.sam-tpl-card{
  text-align:center;padding:14px 10px;border:1px solid var(--sam-border);
  border-radius:10px;font-size:12px;color:var(--sam-text-muted);background:var(--sam-bg-soft);
}
.sam-tpl-card strong{display:block;color:var(--sam-text);margin-bottom:4px;font-size:13px}

.sam-shortcode-list{margin:0;padding-inline-start:20px;line-height:2.1;font-size:13.5px}
.sam-shortcode-list code{background:var(--sam-bg-soft);padding:2px 7px;border-radius:6px;font-size:12.5px}

/* زر حفظ الإعدادات */
.samtim-settings-actions{margin-top:20px;display:flex;gap:10px;flex-wrap:wrap}
/* تبويب «سجل النشاط» للقراءة فقط ويقع خارج فورم الحفظ — أخفِ الزر عند تفعيله.
   المتصفحات بلا :has() تُظهر الزر: الضغط عليه يحفظ الإعدادات بلا تغيير (غير ضار). */
.samtim-settings-tabs:has(.sam-tab-panel[data-tab="activity"].is-active) .samtim-settings-actions{display:none}
.samtim-settings-activity .samtim-table-toolbar{margin-top:0}

@media (max-width:782px){
  .samtim-settings-grid{grid-template-columns:1fr}
  .samtim-field-row,.samtim-field-row.wide{grid-template-columns:1fr}
}

/* ===== Table Toolbar (Compact Filters) ===== */
.samtim-table-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:12px;margin-bottom:12px;box-shadow:var(--sam-shadow-sm);min-height:52px}
.samtim-table-toolbar .samtim-search{position:relative;flex:1 1 240px;max-width:340px;min-width:180px}
.samtim-table-toolbar .samtim-search input{width:100%;height:36px;padding:0 34px 0 12px;border:1px solid var(--sam-border);border-radius:8px;font-size:13px;background:#fff;transition:border-color var(--sam-transition),box-shadow var(--sam-transition);font-family:inherit;line-height:36px}
.samtim-table-toolbar .samtim-search input::placeholder{color:#94a3b8;font-size:13px}
.samtim-table-toolbar .samtim-search input:focus{outline:none;border-color:var(--sam-primary);box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.samtim-table-toolbar .samtim-search::before{content:"";position:absolute;top:50%;right:11px;transform:translateY(-50%);width:13px;height:13px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") center/contain no-repeat;opacity:.55;pointer-events:none}
.samtim-table-toolbar .samtim-search:focus-within::before{opacity:.85}
.samtim-table-toolbar select{height:36px;padding:0 30px 0 14px;border:1px solid var(--sam-border);border-radius:8px;font-size:13px;background:#fff;color:var(--sam-text-soft);min-width:170px;max-width:240px;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path fill='%2364748b' d='M6 8.5L1.5 4h9z'/></svg>");background-repeat:no-repeat;background-position:left 10px center;cursor:pointer;transition:all var(--sam-transition);font-weight:500;font-family:inherit;line-height:1;text-overflow:ellipsis}
.samtim-table-toolbar select:hover{border-color:#cbd5e1;color:var(--sam-text)}
.samtim-table-toolbar select:focus{outline:none;border-color:var(--sam-primary);box-shadow:0 0 0 3px rgba(13,148,136,.12);color:var(--sam-text)}
.samtim-table-toolbar select.is-active{background-color:var(--sam-primary-50);border-color:#5eead4;color:var(--sam-primary-700);font-weight:600;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path fill='%230f766e' d='M6 8.5L1.5 4h9z'/></svg>")}
.samtim-table-toolbar .samtim-toolbar-spacer{flex:1;min-width:0}
.samtim-table-toolbar .samtim-toolbar-info{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;background:var(--sam-bg-soft);border-radius:999px;color:var(--sam-text-muted);font-size:12px;font-weight:600;white-space:nowrap}
.samtim-table-toolbar .samtim-toolbar-info strong{color:var(--sam-primary-700);font-weight:700;font-size:13px}
.samtim-table-toolbar .samtim-reset-filters{display:none;align-items:center;gap:4px;font-size:12px;color:var(--sam-danger);background:transparent;border:1px solid transparent;cursor:pointer;padding:5px 10px;border-radius:8px;transition:all var(--sam-transition);font-weight:600;font-family:inherit}
.samtim-table-toolbar .samtim-reset-filters::before{content:"×";font-size:16px;line-height:1;margin-top:-2px}
.samtim-table-toolbar .samtim-reset-filters:hover{background:#fef2f2;border-color:#fecaca}
.samtim-table-toolbar.has-filters .samtim-reset-filters{display:inline-flex}

/* ===== Tables (Modern Refined) ===== */
.samtim-table-wrap{background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:14px;overflow:hidden;box-shadow:var(--sam-shadow-sm)}
.samtim-table-wrap .samtim-table{margin:0;border:none;border-radius:0;box-shadow:none}
.samtim-table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border-radius:14px;overflow:hidden;border:1px solid var(--sam-border)}
.samtim-table thead{background:#fafbfc}
.samtim-table thead th{padding:12px 16px;text-align:right;font-weight:700;font-size:11px;color:var(--sam-text-muted);border-bottom:1px solid var(--sam-border);white-space:nowrap;background:#fafbfc}
.samtim-table thead th:first-child{padding-inline-start:20px}
.samtim-table thead th:last-child{padding-inline-end:20px}
.samtim-table tbody td{padding:14px 16px;border-bottom:1px solid var(--sam-border-soft);font-size:14px;color:var(--sam-text);vertical-align:middle}
.samtim-table tbody td:first-child{padding-inline-start:20px}
.samtim-table tbody td:last-child{padding-inline-end:20px}
.samtim-table tbody tr{transition:background var(--sam-transition);position:relative}
.samtim-table tbody tr:hover{background:#fafcfe}
.samtim-table tbody tr:hover td:first-child{box-shadow:inset 3px 0 0 var(--sam-primary)}
.samtim-table tbody tr:last-child td{border-bottom:none}
.samtim-table tbody td strong{font-weight:600;color:var(--sam-text)}
.samtim-table tbody td .cell-sub{font-size:12px;color:var(--sam-text-muted);margin-top:3px;font-weight:400}
.samtim-table tbody td .cell-money{font-weight:700;color:var(--sam-text);font-variant-numeric:tabular-nums;direction:ltr;display:inline-block}

/* Avatar/Initial circle */
.cell-with-avatar{display:flex;align-items:center;gap:10px}
.cell-avatar{flex-shrink:0;width:36px;height:36px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;color:#fff;background:linear-gradient(135deg,var(--sam-primary) 0%,var(--sam-primary-700) 100%);text-transform:uppercase;letter-spacing:.02em}
.cell-avatar.invoice{background:linear-gradient(135deg,#6366f1 0%,#4338ca 100%);font-size:11px;border-radius:8px;letter-spacing:0}
.cell-avatar.branch{background:linear-gradient(135deg,#0ea5e9 0%,#0369a1 100%)}
.cell-avatar.trip{background:linear-gradient(135deg,#f59e0b 0%,#b45309 100%)}
.cell-avatar.muted{background:linear-gradient(135deg,#94a3b8 0%,#475569 100%)}
.cell-text{display:flex;flex-direction:column;min-width:0;gap:2px}
.cell-text strong{font-weight:600;font-size:14px;line-height:1.3}

/* ===== Action chips (color-coded) ===== */
.samtim-table .actions{white-space:nowrap;text-align:right;display:flex;gap:6px;justify-content:flex-start;align-items:center}
.samtim-table .actions a,.samtim-table .actions button{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:32px;padding:0 12px;border-radius:8px;font-size:12.5px;font-weight:600;border:1px solid transparent;cursor:pointer;transition:all var(--sam-transition);text-decoration:none;line-height:1;font-family:inherit}
.samtim-table .actions .dashicons{font-size:14px;width:14px;height:14px;line-height:1}

/* Default chip (fallback) */
.samtim-table .actions a,.samtim-table .actions button{background:var(--sam-bg-soft);color:var(--sam-text-soft);border-color:var(--sam-border-soft)}
.samtim-table .actions a:hover,.samtim-table .actions button:hover{background:#fff;border-color:#cbd5e1;color:var(--sam-text);transform:translateY(-1px);box-shadow:var(--sam-shadow-sm)}

/* View — blue */
.samtim-table .actions .action-view{background:#eff6ff;color:#1d4ed8;border-color:#dbeafe}
.samtim-table .actions .action-view:hover{background:#1d4ed8;color:#fff;border-color:#1d4ed8;box-shadow:0 4px 10px -2px rgba(29,78,216,.4)}

/* Edit — amber */
.samtim-table .actions .action-edit{background:#fffbeb;color:#b45309;border-color:#fde68a}
.samtim-table .actions .action-edit:hover{background:#d97706;color:#fff;border-color:#d97706;box-shadow:0 4px 10px -2px rgba(217,119,6,.4)}

/* Print — purple */
.samtim-table .actions .action-print{background:#faf5ff;color:#7e22ce;border-color:#e9d5ff}
.samtim-table .actions .action-print:hover{background:#7e22ce;color:#fff;border-color:#7e22ce;box-shadow:0 4px 10px -2px rgba(126,34,206,.4)}

/* Delete — red */
.samtim-table .actions .action-delete{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
.samtim-table .actions .action-delete:hover{background:#b91c1c;color:#fff;border-color:#b91c1c;box-shadow:0 4px 10px -2px rgba(185,28,28,.4)}

/* Email — teal */
.samtim-table .actions .action-email{background:var(--sam-primary-50);color:var(--sam-primary-700);border-color:#a7f3d0}
.samtim-table .actions .action-email:hover{background:var(--sam-primary-600);color:#fff;border-color:var(--sam-primary-600);box-shadow:0 4px 10px -2px rgba(13,148,136,.4)}

/* Icon-only variant for tight spaces */
.samtim-table .actions .icon-only{width:32px;padding:0;justify-content:center}
.samtim-table .actions .icon-only span:not(.dashicons){display:none}

/* Empty state */
.samtim-table .empty-row td{text-align:center;color:var(--sam-text-muted);padding:60px 16px;font-style:normal;border-bottom:none !important}
.samtim-table .empty-row:hover{background:transparent !important}
.samtim-table .empty-row .empty-state{display:flex;flex-direction:column;align-items:center;gap:10px}
.samtim-table .empty-row .empty-state::before{content:"";width:56px;height:56px;border-radius:50%;background:var(--sam-bg-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") center/24px no-repeat}
.samtim-table .empty-row .empty-state strong{font-size:15px;color:var(--sam-text-soft);font-weight:700}
.samtim-table .empty-row .empty-state span{font-size:13px;color:var(--sam-text-muted)}

/* ===== Status Badges ===== */
.sam-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.4;white-space:nowrap;border:1px solid transparent}
.sam-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.7}
.sam-badge.muted{background:var(--sam-bg-soft);color:var(--sam-text-muted);border-color:var(--sam-border)}
.sam-badge.success{background:#ecfdf5;color:#047857;border-color:#a7f3d0}
.sam-badge.info{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.sam-badge.indigo{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}
.sam-badge.warning{background:#fffbeb;color:#b45309;border-color:#fde68a}
.sam-badge.danger{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
.sam-badge.purple{background:#faf5ff;color:#7e22ce;border-color:#e9d5ff}
.sam-badge.teal{background:#f0fdfa;color:#0f766e;border-color:#99f6e4}
.sam-badge.outline{background:#fff;color:var(--sam-text-muted);border-color:var(--sam-border)}

/* ===== Detail view ===== */
.samtim-list-inline{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.detail-head{display:flex;gap:18px;align-items:center;margin-bottom:22px;padding-bottom:20px;border-bottom:1px solid var(--sam-border-soft)}
.detail-head img,.no-image{width:84px;height:84px;border-radius:18px;object-fit:cover;background:linear-gradient(135deg,var(--sam-primary-50) 0%,#ccfbf1 100%);display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:700;color:var(--sam-primary-600);flex-shrink:0;border:1px solid #99f6e4}
.no-image.small{width:56px;height:56px;font-size:22px;border-radius:14px}
.detail-head h2{margin:0;font-size:22px}
.detail-head .badge{display:inline-block;background:var(--sam-primary-50);color:var(--sam-primary-700);padding:4px 12px;border-radius:999px;font-size:12px;font-weight:700;margin-bottom:8px;border:1px solid #99f6e4}
.detail-item{background:#fff;border:1px solid var(--sam-border);padding:14px 16px;border-radius:12px;transition:border-color var(--sam-transition),box-shadow var(--sam-transition)}
.detail-item:hover{border-color:#cbd5e1;box-shadow:var(--sam-shadow-sm)}
.detail-item span{display:block;color:var(--sam-text-muted);margin-bottom:6px;font-size:12px;font-weight:600}
.detail-item strong{font-size:15px;color:var(--sam-text);font-weight:600;word-break:break-word}
.actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px;padding-top:18px;border-top:1px solid var(--sam-border-soft)}
.detail-card .actions-row{border-top:1px solid var(--sam-border-soft)}

/* ===== Invoice ===== */
.samtim-invoice-layout{display:grid;grid-template-columns:440px 1fr;gap:18px}
.sticky-preview{position:sticky;top:42px}
.invoice-preview,.invoice-view-wrap{background:transparent}
.invoice-paper{max-width:920px;margin:0 auto;background:#fff;border:1px solid var(--sam-border);border-radius:var(--sam-radius-lg);padding:32px;color:var(--sam-text);box-shadow:var(--sam-shadow);--primary:var(--sam-primary-600)}
/* الهيدر عمودان: الشركة (يمين) + بيانات الفاتورة (يسار) — يوفّر ارتفاعًا لطباعة صفحة واحدة */
.invoice-head{display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:16px;border-bottom:3px solid var(--primary);margin-bottom:16px}
.invoice-brand-row{display:flex;gap:16px;align-items:center;justify-content:space-between;flex:1 1 300px;min-width:0;flex-wrap:wrap}
.invoice-company{display:flex;gap:14px;align-items:center;flex:1;min-width:200px}
/* نص الترويسة الحر (أسفل الاسم أو مقابل الشعار) */
.invoice-header-note{margin:0;color:var(--sam-text-soft);font-size:13px;line-height:1.7;white-space:pre-line}
.invoice-header-note[hidden],.invoice-tagline[hidden]{display:none !important}
.invoice-header-note.beside{flex:0 1 46%;text-align:start;padding:10px 14px;background:var(--sam-bg-soft);border:1px solid var(--sam-border-soft);border-radius:12px}
.invoice-company img{width:64px;height:64px;object-fit:contain;border-radius:14px;background:#fff;border:1px solid var(--sam-border-soft);padding:6px}
.invoice-company h2{margin:0 0 6px;font-size:26px;color:var(--primary)}
.invoice-company p{margin:0;color:var(--sam-text-muted);font-size:13px}
/* بيانات الفاتورة: عمود جانبي مضغوط (label ← → value) بدل ثلاث خانات عريضة */
.invoice-meta{display:grid;grid-template-columns:1fr;gap:8px;text-align:start;flex:0 0 auto;width:auto;min-width:200px;max-width:250px}
.invoice-meta div{background:linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);padding:9px 12px;border-radius:12px;border:1px solid var(--sam-border-soft);display:flex;align-items:center;justify-content:space-between;gap:10px}
.invoice-meta span{display:block;color:var(--sam-text-muted);font-size:11px;font-weight:600}
.invoice-meta strong{display:block;margin-top:0;font-size:13px;color:var(--sam-text)}
.invoice-section{margin-top:18px}
.invoice-section.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.invoice-section.three-col{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
/* بيانات العميل/تفاصيل الحجز: كل واحدة صف كامل، وحقولها في عمودين داخليًا (توفير ارتفاع) */
.invoice-section.info-cols{display:grid;grid-template-columns:1fr;gap:14px}
.inv-list-2col{display:grid;grid-template-columns:1fr 1fr;gap:0 26px}
.invoice-section h4{margin:0 0 10px;font-size:14px;color:var(--primary);font-weight:700;display:flex;align-items:center;gap:6px}
.invoice-section h4::before{content:"";width:3px;height:14px;background:var(--primary);border-radius:3px}
.invoice-section ul{list-style:none;padding:0;margin:0}
.invoice-section li{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px dashed var(--sam-border)}
.invoice-section li:last-child{border-bottom:none}
.invoice-section li span{color:var(--sam-text-muted);font-size:13px}
.invoice-section li strong{font-size:14px;text-align:left}
.statbox{background:linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);border:1px solid var(--sam-border-soft);padding:18px;border-radius:14px;text-align:center}
.statbox span{display:block;color:var(--sam-text-muted);font-size:12px;font-weight:600}
.statbox strong{display:block;font-size:22px;margin-top:6px;color:var(--primary);font-weight:800}
.invoice-total{margin-top:22px;background:var(--sam-primary-700);color:#fff;border-radius:var(--sam-radius);padding:22px;display:grid;grid-template-columns:repeat(3,1fr);gap:14px;box-shadow:0 8px 24px -4px rgba(15,118,110,.35)}
.invoice-total > div{text-align:center;padding:6px 8px}
.invoice-total > div + div{border-inline-start:1px solid rgba(255,255,255,.32)}
.invoice-total span{display:block;opacity:.85;font-size:12px;font-weight:600}
.invoice-total strong{display:block;margin-top:6px;font-size:24px;font-weight:800}
.invoice-section p{margin:0;line-height:1.8;color:var(--sam-text)}

/* توقيعات (تحت كتلة التكلفة) */
.invoice-signatures{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:22px}
.invoice-signatures .sign-box{padding:14px 16px;border:1px dashed var(--sam-border);border-radius:12px;text-align:center}
.invoice-signatures .sign-box span{display:block;font-size:12px;font-weight:700;color:var(--sam-text-muted);margin-bottom:26px}
.invoice-signatures .sign-line{height:1px;background:var(--sam-text-muted);opacity:.55;margin:0 8px 8px}
.invoice-signatures .sign-box strong{display:block;font-size:13px;color:var(--sam-text)}

/* فوتر الفاتورة: عمودان — أسطر التواصل (يمين) + النص الحر (يسار) */
.invoice-footer{margin-top:16px;padding-top:12px;border-top:2px solid var(--primary);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px}
.invoice-footer[hidden]{display:none}
.invoice-footer-contact{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 18px;justify-content:flex-start;flex:1 1 240px}
.invoice-footer-contact li{display:flex;gap:5px;align-items:baseline;font-size:12px}
.invoice-footer-contact li span{color:var(--sam-text-muted)}
.invoice-footer-contact li strong{color:var(--sam-text);font-weight:600}
.invoice-footer-note{margin:0;text-align:end;font-size:12px;line-height:1.7;color:var(--sam-text-muted);white-space:pre-line;flex:1 1 240px}
/* لا توجد أسطر تواصل → النص الحر يتمركز ويأخذ العرض كاملًا */
.invoice-footer:not(.has-contact) .invoice-footer-note{text-align:center;flex-basis:100%}
.invoice-footer-note[hidden]{display:none}
.samtim-sidebar{display:flex;flex-direction:column;gap:18px}
.preview-logo-img{max-width:60px}
.invoice-view-wrap{padding:0;background:transparent;border:none;box-shadow:none}
.invoice-view-wrap .invoice-paper{box-shadow:var(--sam-shadow)}
.print-only{display:none}
.readonly-note{font-size:12px;color:var(--sam-text-muted)}

/* ⚠️ العربية خط متّصل: أي letter-spacing/word-spacing يفصل الحروف.
   الأسوأ أن html2canvas (مولّد الـ PDF) يقسّم النص إلى حروف مفردة عندما
   يكون letter-spacing ≠ normal → تفقد الحروف وصلها وينعكس ترتيبها.
   لذا: منع قاطع داخل ورقة الفاتورة (ويغلب أي قاعدة عامة مثل عناوين .samtim-wrap). */
.invoice-paper,.invoice-paper *{letter-spacing:normal !important;word-spacing:normal !important}

/* ===== Notices ===== */
.samtim-wrap .notice,.samtim-frontend .notice{border-radius:12px;border-width:1px;padding:12px 16px}

/* ===== Tools page additions ===== */
.samtim-tool-row{padding:12px 14px;background:var(--sam-bg-soft);border-radius:10px;display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;flex-wrap:wrap;gap:8px}
.samtim-tool-row strong{color:var(--sam-text)}
.samtim-tool-status{font-size:13px;font-weight:700}
.samtim-tool-status.ok{color:#047857}
.samtim-tool-status.miss{color:#b45309}

/* ===== Repeater (أسطر نصية: هيدر/فوتر الفاتورة) ===== */
.samtim-repeater .samtim-field-hint{margin:0 0 8px;font-size:12px;color:var(--sam-text-muted)}
.samtim-rep-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
.samtim-rep-row{display:flex;align-items:center;gap:8px}
.samtim-rep-row input{flex:1;min-width:0}
.sam-rep-remove{display:inline-flex;align-items:center;justify-content:center;color:#b91c1c;cursor:pointer;padding:4px;border:none;background:none}
.sam-rep-remove:hover{color:#7f1d1d}
.sam-rep-add{display:inline-flex;align-items:center;gap:4px}
.sam-rep-add .dashicons{font-size:16px;width:16px;height:16px}

/* ===== Responsive ===== */
@media (max-width:1100px){
  .cards-2,.cards-3,.cards-4,.samtim-invoice-layout,.invoice-section.two-col,.invoice-section.three-col,.invoice-total,.invoice-signatures,.inv-list-2col{grid-template-columns:1fr}
  .invoice-header-note.beside{flex-basis:100%}
  /* شاشة ضيقة: الهيدر يعود عموديًا وبيانات الفاتورة صفٌّ من ثلاث */
  .invoice-head{flex-direction:column}
  .invoice-meta{grid-template-columns:repeat(3,1fr);max-width:none;min-width:0;text-align:center}
  .invoice-meta div{flex-direction:column;justify-content:center;text-align:center}
  .invoice-total > div + div{border-inline-start:none;border-top:1px solid rgba(255,255,255,.15);padding-top:14px}
  .sticky-preview{position:static}
}
@media (max-width:768px){
  .samtim-table thead{display:none}
  .samtim-table tbody td{display:flex;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--sam-border-soft)}
  .samtim-table tbody td::before{content:attr(data-label);font-weight:700;color:var(--sam-text-muted);font-size:12px;text-transform:uppercase}
  .samtim-table tbody tr{display:block;border:1px solid var(--sam-border);border-radius:12px;margin-bottom:10px;background:#fff}
  .samtim-table tbody tr:hover{background:#fff}
  .samtim-table .actions{justify-content:flex-end}
  .samtim-table .actions::before{display:none}
  .samtim-table-wrap{border:none;background:transparent;box-shadow:none;padding:0}
  .invoice-paper{padding:20px}
  .invoice-meta{grid-template-columns:1fr;text-align:right}
}

/* ===== Invoice Print Templates ===== */
.invoice-paper.invoice-tpl-classic{--primary:#1f2937;border:2px solid #1f2937;padding:36px;font-family:"Times New Roman",Georgia,serif}
.invoice-paper.invoice-tpl-classic .invoice-head{border-bottom:2px solid #1f2937;padding-bottom:18px}
.invoice-paper.invoice-tpl-classic .invoice-company h2{color:#1f2937;font-family:inherit}
.invoice-paper.invoice-tpl-classic .invoice-meta div{background:#fff;border:1px solid #1f2937;border-radius:4px}
.invoice-paper.invoice-tpl-classic .invoice-section h4{color:#1f2937;border-bottom:1px solid #cbd5e1;padding-bottom:6px}
.invoice-paper.invoice-tpl-classic .invoice-section h4::before{display:none}
.invoice-paper.invoice-tpl-classic .invoice-total{background:#1f2937 !important;border-radius:4px}
.invoice-paper.invoice-tpl-classic .statbox{background:#fff;border:1px solid #1f2937;border-radius:4px}
.invoice-paper.invoice-tpl-classic .invoice-meta strong,.invoice-paper.invoice-tpl-classic .statbox strong{color:#1f2937}

.invoice-paper.invoice-tpl-compact{padding:20px;font-size:12.5px}
.invoice-paper.invoice-tpl-compact .invoice-head{padding-bottom:12px;margin-bottom:12px;border-bottom-width:2px}
.invoice-paper.invoice-tpl-compact .invoice-company img{width:46px;height:46px}
.invoice-paper.invoice-tpl-compact .invoice-company h2{font-size:18px}
.invoice-paper.invoice-tpl-compact .invoice-section{margin-top:10px}
.invoice-paper.invoice-tpl-compact .invoice-section li{padding:5px 0;font-size:12px}
.invoice-paper.invoice-tpl-compact .invoice-section h4{font-size:12px;margin-bottom:6px}
.invoice-paper.invoice-tpl-compact .statbox{padding:10px}
.invoice-paper.invoice-tpl-compact .statbox strong{font-size:16px;margin-top:3px}
.invoice-paper.invoice-tpl-compact .invoice-total{padding:14px;margin-top:14px}
.invoice-paper.invoice-tpl-compact .invoice-total strong{font-size:18px}
.invoice-paper.invoice-tpl-compact .invoice-meta div{padding:7px 10px}

/* Modern (default) reinforcement */
.invoice-paper.invoice-tpl-modern{background:linear-gradient(180deg,#ffffff 0%,#fafbff 100%)}
.invoice-paper.invoice-tpl-modern .invoice-head{position:relative}
.invoice-paper.invoice-tpl-modern .invoice-head::after{content:"";position:absolute;bottom:-3px;right:0;width:80px;height:3px;background:var(--sam-accent,#f59e0b);border-radius:3px}

/* ===== Print (preserves on-screen look 1:1 — same grids, same colors) ===== */
@page{size:A4;margin:5mm}
@media print{
  /* Print colors exactly as shown on screen */
  *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important}
  /* وصل الحروف العربية عند الطباعة (لا تباعد حروف/كلمات مهما ورث العنصر). */
  *{letter-spacing:normal !important;word-spacing:normal !important}

  /* التوقيعات والفوتر لا يُقطعان بين صفحتين، ويبقى الترتيب كما على الشاشة. */
  .invoice-signatures,.invoice-footer,.invoice-brand-row{break-inside:avoid;page-break-inside:avoid}
  .invoice-signatures{display:grid !important;grid-template-columns:1fr 1fr !important}
  .invoice-brand-row{display:flex !important;flex-direction:row !important;flex-wrap:wrap !important}
  html,body{background:#fff !important;margin:0 !important;padding:0 !important;width:auto !important;min-width:0 !important}

  /* ===== Theme-agnostic print isolation =====
     Hide the ENTIRE page, then reveal ONLY the invoice paper. This does NOT
     depend on the active theme's markup/class names, so it removes the theme
     header/navbar/footer with the current theme (Gado) OR any other theme.
     A visible child inside a hidden ancestor still prints (visibility trick). */
  body *{visibility:hidden !important}
  .invoice-paper,.invoice-paper *{visibility:visible !important}
  /* Collapse the biggest chrome elements so they reserve no page height
     (prevents blank leading/trailing pages from hidden-but-spaced markup). */
  nav,header,footer,aside,#wpadminbar,.print-hide,.invoice-tpl-picker{display:none !important}
  /* Kill any top offset a theme reserves for a fixed/sticky navbar, so the
     invoice starts at the very top with no blank band above it. */
  html,body{padding-top:0 !important;margin-top:0 !important}
  /* Pin the invoice to the page's top-left. This guarantees zero leading space
     regardless of wrapper padding/margins in ANY theme. (Invoices are A4 single
     page; page-break hints below still apply if content overflows.) */
  .invoice-paper{position:absolute !important;inset:0 auto auto 0 !important;width:100% !important}

  /* Hide WP/theme/plugin chrome */
  #wpadminbar,#adminmenumain,#adminmenuback,#adminmenuwrap,#wpfooter,
  .notice,.update-nag,
  header,footer,.site-header,.site-footer,#masthead,#colophon,nav.main-navigation,
  aside,#secondary,.widget-area,.entry-header,.entry-meta,.entry-footer,
  .post-navigation,.comments-area,
  .samtim-sidebar,.samtim-header,.actions-row,.samtim-portal-nav,.sam-nav-toggle,
  .samtim-table-toolbar,.samtim-card.samtim-tools-card,.samtim-welcome,
  .invoice-tpl-picker,.print-hide,.samtim-grid,.samtim-form-footer,
  .sam-fullscreen-btn,.sam-theme-toggle
  {display:none !important}

  /* Strip ALL outer wrappers so the invoice fills the page edge-to-edge */
  #wpcontent,#wpbody-content,#wpbody,.wrap,.samtim-wrap,.samtim-frontend,
  .entry-content,.site-main,.site-content,main,
  .samtim-card.invoice-view-wrap,.invoice-view-wrap{
    margin:0 !important;padding:0 !important;
    background:#fff !important;
    max-width:none !important;width:100% !important;min-width:0 !important;
    border:none !important;box-shadow:none !important;
    float:none !important;display:block !important;
  }

  /* Invoice paper: keep its inner padding (matches preview) but strip outer chrome.
     Left in normal flow (NOT absolute) so multi-page invoices paginate correctly;
     the visibility isolation above + display:none on nav/header/footer already
     remove all theme chrome, so the paper sits at the top with no blank pages. */
  .invoice-paper{
    margin:0 !important;
    border:none !important;
    box-shadow:none !important;
    border-radius:0 !important;
    max-width:none !important;
    width:100% !important;
    background:#fff !important;
  }

  /* CRITICAL: A4 print width (~720px) is BELOW our 780px responsive breakpoint,
     which would collapse all multi-column grids to a single column.
     Force them back to their desktop layout so print matches preview exactly. */
  /* الهيدر عمودان جنبًا لجنب على الورق (الشركة يمين + بيانات الفاتورة يسار). */
  .invoice-head{display:flex !important;flex-direction:row !important;flex-wrap:wrap !important;align-items:flex-start !important;justify-content:space-between !important;gap:20px !important}
  .invoice-brand-row{flex:1 1 auto !important;min-width:0 !important}
  /* flex:1 لا width:100% — وإلا دفعَ نصَّ الترويسة المقابل للشعار إلى سطر جديد. */
  .invoice-company{display:flex !important;flex-direction:row !important;gap:14px !important;align-items:center !important;flex:1 1 auto !important;min-width:200px !important}
  .invoice-header-note.beside{flex:0 1 46% !important}
  /* بيانات الفاتورة: عمود جانبي مضغوط. */
  .invoice-meta{display:grid !important;grid-template-columns:1fr !important;gap:8px !important;text-align:start !important;width:auto !important;flex:0 0 auto !important;min-width:190px !important;max-width:240px !important}
  .invoice-meta div{display:flex !important;flex-direction:row !important;align-items:center !important;justify-content:space-between !important;gap:10px !important;text-align:start !important}
  .invoice-section.two-col{display:grid !important;grid-template-columns:1fr 1fr !important;gap:14px !important}
  .invoice-section.three-col{display:grid !important;grid-template-columns:repeat(3,1fr) !important;gap:14px !important}
  /* بيانات العميل/الحجز: صف كامل، والحقول عمودان داخليًا. */
  .invoice-section.info-cols{display:grid !important;grid-template-columns:1fr !important;gap:14px !important}
  .inv-list-2col{display:grid !important;grid-template-columns:1fr 1fr !important;gap:0 26px !important}
  /* الفوتر عمودان على الورق. */
  .invoice-footer{display:flex !important;flex-direction:row !important;flex-wrap:wrap !important;align-items:center !important;justify-content:space-between !important;gap:12px 24px !important}
  .invoice-footer-contact{justify-content:flex-start !important;flex:1 1 240px !important}
  .invoice-footer-note{text-align:end !important;flex:1 1 240px !important}
  .invoice-footer:not(.has-contact) .invoice-footer-note{text-align:center !important;flex-basis:100% !important}

  /* Total box: solid green, rounded corners, padding AND visible separators */
  .invoice-total{
    display:grid !important;
    grid-template-columns:repeat(3,1fr) !important;
    gap:14px !important;
    padding:22px !important;
    margin-top:22px !important;
    border-radius:14px !important;
    background:var(--sam-primary-700) !important;
    color:#fff !important;
    /* Fallback outline in case the background doesn't render on some printers */
    border:1px solid var(--sam-primary-700) !important;
    box-shadow:none !important;
  }
  .invoice-total > div{
    text-align:center !important;
    padding:6px 8px !important;
    border-top:none !important;
  }
  /* Visible separators between the 3 cells (low opacity is invisible on paper) */
  .invoice-total > div + div{
    border-inline-start:1px solid rgba(255,255,255,.55) !important;
    border-top:none !important;
    padding-top:6px !important;
  }
  .invoice-total span,.invoice-total strong{color:#fff !important}

  .invoice-section li{display:flex !important;flex-direction:row !important;justify-content:space-between !important;gap:10px !important}

  /* Arrival / departure: stack them (arrival on top, departure below) on print */
  .invoice-section li .preview-dates{display:flex !important;flex-direction:column !important;align-items:flex-end !important;gap:2px !important;text-align:end !important}
  .invoice-section li .preview-dates .preview-date-sep{display:none !important}

  /* Force light look during print even when dark theme is active */
  html[data-sam-theme="dark"],html[data-sam-theme="dark"] body{background:#fff !important}
  html[data-sam-theme="dark"] .invoice-paper{background:#fff !important;color:#0f172a !important;border-color:#e2e8f0 !important}
  html[data-sam-theme="dark"] .invoice-paper *{color:inherit}
  html[data-sam-theme="dark"] .invoice-total,html[data-sam-theme="dark"] .invoice-total *{color:#fff !important}
  html[data-sam-theme="dark"] .invoice-meta div,html[data-sam-theme="dark"] .statbox{background:#f8fafc !important;border-color:#e2e8f0 !important;color:#0f172a !important}
  html[data-sam-theme="dark"] .invoice-section li,html[data-sam-theme="dark"] .invoice-section li *{color:#0f172a !important}
  html[data-sam-theme="dark"] .invoice-section li span,html[data-sam-theme="dark"] .invoice-section li{border-color:#cbd5e1 !important}

  /* Page-break hints */
  .invoice-head,.invoice-section,.invoice-total{page-break-inside:avoid}
}

/* =====================================================
   Phase 1 — قوائم server-side: ترقيم + ترتيب + توولبار
   ===================================================== */
.samtim-toolbar-server{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.samtim-toolbar-server .samtim-search{flex:1 1 240px;min-width:180px}
.samtim-toolbar-server input[type="search"],
.samtim-toolbar-server input[type="date"],
.samtim-toolbar-server select{height:38px;border:1px solid var(--sam-border,#e2e8f0);border-radius:8px;padding:0 10px;background:var(--sam-surface,#fff);color:var(--sam-text,#0f172a);font:inherit}
.samtim-toolbar-server input[type="search"]{width:100%}
.samtim-toolbar-server .samtim-search-btn{height:38px;display:inline-flex;align-items:center;gap:4px}
.samtim-toolbar-server .samtim-reset-filters{color:var(--sam-text-soft,#64748b);text-decoration:none;font-size:13px;padding:0 6px}
.samtim-toolbar-server .samtim-reset-filters:hover{color:var(--sam-danger,#dc2626)}

/* رؤوس الأعمدة القابلة للترتيب */
.samtim-table th.sam-sortable{padding:0}
.samtim-table th.sam-sortable>a{display:block;padding:12px 14px;color:inherit;text-decoration:none;white-space:nowrap}
.samtim-table th.sam-sortable>a:hover{color:var(--sam-primary,#0f766e)}
.samtim-table th.sam-sortable.is-sorted>a{color:var(--sam-primary,#0f766e);font-weight:700}

/* شريط الترقيم */
.samtim-pagination-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:10px 4px}
.samtim-found{color:var(--sam-text-soft,#64748b);font-size:13px}
.samtim-pagination{display:flex;flex-wrap:wrap;gap:4px}
.samtim-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;border:1px solid var(--sam-border,#e2e8f0);border-radius:8px;background:var(--sam-surface,#fff);color:var(--sam-text,#0f172a);text-decoration:none;font-size:14px}
.samtim-pagination a.page-numbers:hover{border-color:var(--sam-primary,#0f766e);color:var(--sam-primary,#0f766e)}
.samtim-pagination .page-numbers.current{background:var(--sam-primary,#0f766e);border-color:var(--sam-primary,#0f766e);color:#fff;font-weight:700}
.samtim-pagination .page-numbers.dots{border:none;background:none}

/* زر مشاركة PDF أثناء التجهيز */
.sam-wa-pdf-btn.is-busy{opacity:.7;pointer-events:none;cursor:progress}

/* الإجراءات الجماعية */
.samtim-bulk-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 10px;padding:10px 12px;background:var(--sam-surface-soft,#f1f5f9);border:1px solid var(--sam-border,#e2e8f0);border-radius:10px}
.samtim-bulk-count{font-size:13px;color:var(--sam-text-soft,#64748b);font-weight:700}
.samtim-bulk-bar select{height:34px;border:1px solid var(--sam-border,#e2e8f0);border-radius:8px;padding:0 8px;background:var(--sam-surface,#fff);color:var(--sam-text,#0f172a);font:inherit}
.samtim-table th.sam-check-col,.samtim-table td.sam-check-col{width:38px;text-align:center;padding-inline:8px}
.samtim-table .samtim-row-check,.samtim-table .samtim-check-all{width:16px;height:16px;cursor:pointer}

@media (max-width:768px){
  .samtim-pagination-bar{flex-direction:column;align-items:stretch;text-align:center}
  .samtim-toolbar-server .samtim-search{flex-basis:100%}
}

/* =====================================================
   التقارير (Phase 5)
   ===================================================== */
.mt-16{margin-top:16px}
.samtim-reports-filter{margin-bottom:6px}
.samtim-reports-filter .samtim-export-btn{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px}
/* شريط نسبة CSS بسيط (بلا مكتبة رسم) */
.sam-bar{display:block;width:100%;min-width:80px;height:12px;background:var(--sam-surface-soft,#f1f5f9);border-radius:999px;overflow:hidden}
.sam-bar-fill{display:block;height:100%;background:var(--sam-primary,#0f766e);border-radius:999px}
@media (max-width:768px){
  .samtim-reports-filter .samtim-export-btn{margin-inline-start:0}
  .sam-bar{min-width:120px}
}

/* =====================================================
   الإضافة السريعة (Quick Add) — زر (+) + نافذة منبثقة
   ===================================================== */
.sam-select-with-add{display:flex;align-items:center;gap:6px}
.sam-select-with-add select,.sam-select-with-add .sam-select{flex:1;min-width:0}
.sam-quick-add{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid var(--sam-border);border-radius:var(--sam-radius-sm);background:var(--sam-card-bg);color:var(--sam-primary-600);cursor:pointer;transition:var(--sam-transition)}
.sam-quick-add:hover{background:var(--sam-primary);border-color:var(--sam-primary);color:#fff}
.sam-quick-add:focus-visible{outline:2px solid var(--sam-primary);outline-offset:2px}
.sam-quick-add .dashicons{width:18px;height:18px;font-size:18px;line-height:1}

body.samtim-modal-open{overflow:hidden}
.samtim-modal{position:fixed;inset:0;z-index:100050;display:flex;align-items:center;justify-content:center;padding:20px}
.samtim-modal[hidden]{display:none}
.samtim-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(2px)}
.samtim-modal-panel{position:relative;z-index:1;display:flex;flex-direction:column;width:min(880px,100%);max-height:88vh;background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:var(--sam-radius-lg);box-shadow:var(--sam-shadow-lg);overflow:hidden;animation:samFadeIn .2s ease-out}
.samtim-modal-panel[hidden]{display:none}
.samtim-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px;border-bottom:1px solid var(--sam-border-soft)}
.samtim-modal-head h2{margin:0;font-size:17px;font-weight:700;color:var(--sam-text)}
.samtim-modal-close{border:0;background:transparent;font-size:26px;line-height:1;color:var(--sam-text-muted);cursor:pointer;padding:0 4px}
.samtim-modal-close:hover{color:var(--sam-danger)}
.samtim-modal-body{padding:16px 20px;overflow-y:auto}
.samtim-modal-body .samtim-card{box-shadow:none;padding:14px}
.samtim-modal-body .description{margin:6px 0;color:var(--sam-text-muted);font-size:12px}
.samtim-modal-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 20px;border-top:1px solid var(--sam-border-soft);background:var(--sam-bg-soft)}
.samtim-modal-actions{display:flex;gap:8px;margin-inline-start:auto}
.samtim-modal-error{margin:0;color:var(--sam-danger);font-size:13px;font-weight:600}
.samtim-modal-error[hidden]{display:none}

@media (max-width:768px){
  .samtim-modal{padding:0}
  .samtim-modal-panel{width:100%;max-height:100vh;border-radius:0;border:0}
  .samtim-modal-body .samtim-grid.cards-2{grid-template-columns:1fr}
}

/* =====================================================
   قائمة منسدلة قابلة للبحث (بديل select2 — بلا مكتبات)
   ⚠️ الـ <select> الأصلي يبقى في DOM ويُخفى بـ opacity لا display:none —
   لأن display:none يكسر تحقق HTML5 على الحقول required (غير قابلة للتركيز).
   ===================================================== */
.sam-select{position:relative;width:100%}
.sam-select-native{position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none;z-index:-1}
.sam-select-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:38px;padding:0 12px;border:1px solid var(--sam-border);border-radius:var(--sam-radius-sm);background:#fff;color:var(--sam-text);font:inherit;font-size:14px;text-align:start;cursor:pointer;transition:var(--sam-transition)}
.sam-select-toggle:hover{border-color:var(--sam-primary)}
.sam-select-toggle:focus-visible{outline:2px solid var(--sam-primary);outline-offset:1px}
.sam-select.is-open .sam-select-toggle{border-color:var(--sam-primary);box-shadow:0 0 0 3px var(--sam-primary-50)}
.sam-select-toggle.is-empty .sam-select-label{color:var(--sam-text-muted)}
.sam-select-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sam-select-arrow{flex:0 0 auto;font-size:16px;width:16px;height:16px;color:var(--sam-text-muted);transition:transform var(--sam-transition)}
.sam-select.is-open .sam-select-arrow{transform:rotate(180deg)}
.sam-select-drop{position:absolute;z-index:100060;top:calc(100% + 4px);inset-inline:0;background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:var(--sam-radius-sm);box-shadow:var(--sam-shadow-lg);overflow:hidden}
.sam-select-drop[hidden]{display:none}
.sam-select-search{padding:8px;border-bottom:1px solid var(--sam-border-soft)}
.sam-select-search[hidden]{display:none}
.sam-select-search input{width:100%;height:34px;padding:0 10px;border:1px solid var(--sam-border);border-radius:6px;background:#fff;color:var(--sam-text);font:inherit;font-size:13px}
.sam-select-options{list-style:none;margin:0;padding:4px;max-height:240px;overflow-y:auto}
.sam-select-option{padding:8px 10px;border-radius:6px;font-size:14px;color:var(--sam-text);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sam-select-option[hidden]{display:none}
.sam-select-option:hover,.sam-select-option.is-active{background:var(--sam-bg-soft)}
.sam-select-option.is-selected{background:var(--sam-primary-50);color:var(--sam-primary-700);font-weight:700}
.sam-select-option.is-placeholder{color:var(--sam-text-muted)}
.sam-select-empty{padding:12px;text-align:center;font-size:13px;color:var(--sam-text-muted)}
.sam-select-empty[hidden]{display:none}
/* داخل شريط الفلاتر: ارتفاع أصغر يطابق بقية الحقول */
.samtim-table-toolbar .sam-select{min-width:150px;width:auto}
.samtim-table-toolbar .sam-select-toggle{height:36px;font-size:13px}
.samtim-bulk-bar .sam-select-toggle{height:34px;font-size:13px}

/* =====================================================
   Datepicker (jQuery UI من نواة WP — الثيم من عندنا، RTL)
   ===================================================== */
.sam-date-input{cursor:pointer;background:#fff !important}
.ui-datepicker{z-index:100070 !important;width:270px;padding:10px;background:var(--sam-card-bg);border:1px solid var(--sam-border);border-radius:var(--sam-radius);box-shadow:var(--sam-shadow-lg);font-family:inherit;font-size:13px;direction:rtl}
.ui-datepicker .ui-datepicker-header{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px}
.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{order:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;color:var(--sam-text-soft);background:var(--sam-bg-soft)}
.ui-datepicker .ui-datepicker-prev:hover,.ui-datepicker .ui-datepicker-next:hover{background:var(--sam-primary);color:#fff}
.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:none}
.ui-datepicker .ui-datepicker-prev::after{content:"›"}
.ui-datepicker .ui-datepicker-next::after{content:"‹"}
.ui-datepicker .ui-datepicker-title{display:flex;gap:6px;flex:1;justify-content:center}
.ui-datepicker .ui-datepicker-title select{height:30px;padding:0 6px;border:1px solid var(--sam-border);border-radius:6px;background:#fff;color:var(--sam-text);font:inherit;font-size:13px}
.ui-datepicker table{width:100%;border-collapse:collapse;margin:0}
.ui-datepicker th{padding:6px 0;text-align:center;font-size:11px;font-weight:700;color:var(--sam-text-muted)}
.ui-datepicker td{padding:1px;text-align:center}
.ui-datepicker td a,.ui-datepicker td span{display:block;padding:7px 0;border-radius:6px;font-size:13px;color:var(--sam-text);text-decoration:none}
.ui-datepicker td a:hover{background:var(--sam-bg-soft)}
.ui-datepicker td .ui-state-active{background:var(--sam-primary) !important;color:#fff !important;font-weight:700}
.ui-datepicker td.ui-datepicker-today a{border:1px solid var(--sam-primary);color:var(--sam-primary-700);font-weight:700}
.ui-datepicker td.ui-datepicker-other-month span,.ui-datepicker td.ui-datepicker-other-month a{color:var(--sam-text-muted);opacity:.55}
.ui-datepicker td.ui-state-disabled span{color:var(--sam-text-muted);opacity:.4}
