/* ==========================================================================
   TradeInfra — member area (register, login, dashboards)
   Inherits the theme's tokens where present, with fallbacks so the member area
   still renders correctly if the theme is ever swapped.
   ========================================================================== */

/* Palette fallbacks for when the member area is used without the TradeInfra
   theme. `:where()` carries zero specificity, so the theme's own :root values
   win whenever it is active.

   These must NOT be written as `--x: var(--x, fallback)`: a custom property
   referencing itself is a cycle, which makes it invalid at computed-value time
   and resolves every use of it to nothing — silently stripping the colour off
   buttons and badges. */
:where(:root){
	--ti-navy-900:#04182E;
	--ti-navy-800:#0A2A4A;
	--ti-navy-700:#113A63;
	--ti-navy-600:#1A4E80;
	--ti-blue-500:#2A6FB5;
	--ti-blue-100:#E8F0FA;
	--ti-gold-600:#A8791D;
	--ti-gold-500:#C8942A;
	--ti-gold-400:#E0AC46;
	--ti-gold-100:#FBF3E2;
	--ti-slate:#55637A;
	--ti-mute:#7A8699;
	--ti-gray-100:#F4F6F9;
	--ti-gray-200:#E7EBF1;
	--ti-gray-300:#D3DAE5;
}

/* ------------------------------------------------------- Auth layouts --- */

.ti-authwrap{
	display:grid;gap:clamp(1.5rem,4vw,2.5rem);
	max-width:1100px;margin-inline:auto;
	padding-block:clamp(2rem,5vw,3.5rem);
	align-items:start;
}
@media (min-width:940px){ .ti-authwrap{grid-template-columns:.85fr 1.15fr} }
.ti-authwrap--narrow{max-width:520px;grid-template-columns:1fr!important}

.ti-panel{
	padding:clamp(1.5rem,3vw,2.25rem);
	background:#fff;border:1px solid var(--ti-gray-200);border-radius:16px;
	box-shadow:0 4px 12px rgba(10,42,74,.07);
}
.ti-panel--center{max-width:640px;margin-inline:auto;text-align:center}
.ti-panel__title{margin:0 0 .5rem;font-size:1.5rem;color:var(--ti-navy-800)}
.ti-panel__lede{margin:0 0 1.5rem;color:var(--ti-slate);font-size:.95rem}

.ti-rolecard{
	padding:1.75rem;margin-bottom:1.25rem;
	background:linear-gradient(165deg,var(--ti-navy-800),var(--ti-navy-900));
	border-radius:16px;color:rgba(255,255,255,.8);
}
.ti-rolecard__icon{
	display:inline-flex;align-items:center;justify-content:center;
	width:52px;height:52px;margin-bottom:1rem;
	background:rgba(224,172,70,.16);color:var(--ti-gold-400);border-radius:12px;
}
.ti-rolecard__eyebrow{margin:0 0 .25rem;color:var(--ti-gold-400);font-size:.75rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase}
.ti-rolecard__title{margin:0 0 .75rem;color:#fff;font-size:1.5rem;letter-spacing:-.02em}
.ti-rolecard__body{margin:0 0 1.25rem;font-size:.92rem;line-height:1.6}
.ti-rolecard__switch{color:var(--ti-gold-400);font-size:.85rem;font-weight:600;text-decoration:underline;text-underline-offset:3px}

.ti-checklist{list-style:none;margin:0;padding:0}
.ti-checklist li{display:flex;gap:.6rem;align-items:flex-start;margin-bottom:.75rem;color:var(--ti-slate);font-size:.88rem}
.ti-checklist svg{flex:0 0 18px;margin-top:2px;color:var(--ti-gold-600)}

.ti-submitted__tick{
	display:inline-flex;align-items:center;justify-content:center;
	width:72px;height:72px;margin-bottom:1rem;
	background:#E8F6EE;color:#1B7C46;border-radius:50%;
}
.ti-lead{color:var(--ti-slate);font-size:1.05rem}
.ti-muted{color:var(--ti-mute);font-size:.88rem}

.ti-steps{list-style:none;margin:1.75rem 0;padding:0;text-align:left;display:grid;gap:.75rem}
.ti-steps li{
	display:flex;flex-direction:column;gap:.15rem;
	padding:.9rem 1.1rem;border:1px solid var(--ti-gray-200);border-left:3px solid var(--ti-gray-300);
	border-radius:10px;background:var(--ti-gray-100);
}
.ti-steps li strong{color:var(--ti-navy-800);font-size:.95rem}
.ti-steps li span{color:var(--ti-mute);font-size:.82rem}
.ti-steps li.is-done{border-left-color:#1B7C46;background:#F2FAF5}
.ti-steps li.is-current{border-left-color:var(--ti-gold-500);background:var(--ti-gold-100)}
.ti-steps--flow{margin-top:1rem}

/* ------------------------------------------------------------- Alerts --- */

.ti-alert{padding:.95rem 1.15rem;border-radius:10px;font-size:.9rem;margin-bottom:1.25rem}
.ti-alert--success{background:#E8F6EE;border:1px solid #A8DCC0;color:#1B5E38}
.ti-alert--error{background:#FDECEC;border:1px solid #F1B9B9;color:#8C1D22}
.ti-alert ul{margin:.5rem 0 0;padding-left:1.15rem}

/* --------------------------------------------------------- Dashboard --- */

.ti-dash{
	display:grid;gap:clamp(1.25rem,2.5vw,2rem);
	width:100%;margin-inline:auto;
	padding-block:clamp(1.5rem,3vw,2.25rem);
	align-items:start;
}
/* Sidebar stays a fixed, readable width; the working area takes the rest, so
   tables get the room they need on large screens instead of being boxed in. */
@media (min-width:940px){ .ti-dash{grid-template-columns:248px minmax(0,1fr)} }
@media (min-width:1500px){ .ti-dash{grid-template-columns:268px minmax(0,1fr)} }

.ti-dash__side{
	position:sticky;top:100px;
	padding:1.25rem;background:#fff;
	border:1px solid var(--ti-gray-200);border-radius:16px;
	box-shadow:0 2px 8px rgba(10,42,74,.05);
}
@media (max-width:939px){ .ti-dash__side{position:static} }

.ti-dash__me{display:flex;gap:.75rem;align-items:center;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--ti-gray-200)}
.ti-avatar{
	display:inline-flex;align-items:center;justify-content:center;
	width:44px;height:44px;flex:0 0 44px;
	background:linear-gradient(160deg,var(--ti-navy-700),var(--ti-navy-900));
	color:var(--ti-gold-400);border-radius:12px;font-weight:700;font-size:.95rem;
}
.ti-dash__me-body{min-width:0}
.ti-dash__me-body strong{display:block;color:var(--ti-navy-800);font-size:.92rem;line-height:1.3;overflow-wrap:anywhere}
.ti-dash__me-body span{color:var(--ti-mute);font-size:.78rem}

.ti-dash__nav ul{list-style:none;margin:0;padding:0}
.ti-dash__nav li{margin:0}
.ti-dash__nav a{
	display:flex;align-items:center;gap:.65rem;
	padding:.6rem .7rem;margin-bottom:.15rem;border-radius:8px;
	color:var(--ti-slate);font-size:.9rem;font-weight:500;text-decoration:none;
	transition:background .16s ease,color .16s ease;
}
.ti-dash__nav a:hover{background:var(--ti-gray-100);color:var(--ti-navy-800)}
.ti-dash__nav a.is-active{background:var(--ti-navy-800);color:#fff;font-weight:600}
.ti-dash__nav a.is-active svg{color:var(--ti-gold-400)}
.ti-dash__nav svg{flex:0 0 19px;opacity:.9}
.ti-pill{
	margin-left:auto;min-width:20px;height:20px;padding:0 6px;
	display:inline-flex;align-items:center;justify-content:center;
	background:var(--ti-gold-500);color:var(--ti-navy-900);
	border-radius:999px;font-size:.7rem;font-weight:700;
}
.ti-dash__signout{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--ti-gray-200)}

/* Every column in the member area must be allowed to shrink. A grid or flex
   child defaults to min-width:auto, which refuses to go below its content and
   is the usual cause of a page overflowing sideways on a phone. */
.ti-dash,.ti-dash__main,.ti-dash__side{min-width:0;max-width:100%}
.ti-dash__main{min-width:0}
.ti-view__title,.ti-view__lede,.ti-card__title{overflow-wrap:anywhere}
.ti-view__head{min-width:0}
.ti-view__head>div{min-width:0}

@media (max-width:480px){
	.ti-statgrid{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:.75rem}
	.ti-statcard{padding:.9rem}
	.ti-statcard__value{font-size:1.6rem}
	.ti-view__head .ti-btn{width:100%}
}

/* ------------------------------------------------------------- Views --- */

.ti-view__head{
	display:flex;flex-wrap:wrap;gap:1rem;align-items:flex-start;justify-content:space-between;
	margin-bottom:1.5rem;
}
.ti-view__eyebrow{margin:0 0 .2rem;color:var(--ti-mute);font-size:.8rem;font-weight:700;letter-spacing:.06em}
.ti-view__title{margin:0 0 .35rem;font-size:clamp(1.5rem,3vw,2rem);color:var(--ti-navy-800);letter-spacing:-.02em}
.ti-view__lede{margin:0;color:var(--ti-slate);font-size:.95rem;max-width:60ch}
.ti-back{margin:0 0 .75rem;font-size:.88rem}

.ti-statgrid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));margin-bottom:1.5rem}
.ti-statcard{
	display:flex;flex-direction:column;gap:.2rem;
	padding:1.15rem;background:#fff;text-decoration:none;
	border:1px solid var(--ti-gray-200);border-radius:14px;
	transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.ti-statcard:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(10,42,74,.09);border-color:var(--ti-gray-300)}
.ti-statcard.is-hot{border-color:var(--ti-gold-500);background:var(--ti-gold-100)}
.ti-statcard__value{color:var(--ti-navy-800);font-size:1.9rem;font-weight:800;line-height:1;letter-spacing:-.02em}
.ti-statcard__label{color:var(--ti-mute);font-size:.8rem;line-height:1.4}

.ti-cols{display:grid;gap:1.25rem}
@media (min-width:820px){ .ti-cols{grid-template-columns:1fr 1fr} }

.ti-card{
	padding:clamp(1.15rem,2.5vw,1.75rem);margin-bottom:1.25rem;
	background:#fff;border:1px solid var(--ti-gray-200);border-radius:14px;
	box-shadow:0 2px 8px rgba(10,42,74,.05);
}
.ti-card__head{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;margin-bottom:1rem}
.ti-card__head h2{margin:0;font-size:1.05rem;color:var(--ti-navy-800)}
.ti-card__title{margin:0 0 .35rem;font-size:1.05rem;color:var(--ti-navy-800)}
.ti-card__subtitle{margin:1.5rem 0 .75rem;font-size:.95rem;color:var(--ti-navy-800)}
.ti-card__lede{margin:0 0 1.15rem;color:var(--ti-slate);font-size:.9rem}
.ti-card--empty{text-align:center}
.ti-empty{margin:0;color:var(--ti-mute);font-size:.9rem}

/* Proper empty state: a wide card holding one short sentence reads as a bug.
   Give it an icon, a heading and an action, with the text held to a readable
   measure so it stays centred rather than stretching across the viewport. */
.ti-emptystate{
	display:flex;flex-direction:column;align-items:center;text-align:center;
	padding:clamp(2.25rem,5vw,3.5rem) 1.5rem;
}
.ti-emptystate__icon{
	display:inline-flex;align-items:center;justify-content:center;
	width:64px;height:64px;margin-bottom:1.15rem;
	background:var(--ti-blue-100);color:var(--ti-navy-700);
	border-radius:50%;
}
.ti-emptystate__title{margin:0 0 .5rem;color:var(--ti-navy-800);font-size:1.15rem}
.ti-emptystate__text{margin:0;max-width:46ch;color:var(--ti-slate);font-size:.92rem;line-height:1.65}
.ti-emptystate__action{margin-top:1.5rem}

.ti-block{margin-top:1.25rem}
.ti-block h3{margin:0 0 .4rem;font-size:.85rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ti-gold-600)}
.ti-block p{margin:0 0 .5rem;color:var(--ti-slate);font-size:.92rem;line-height:1.65}

.ti-defs{display:grid;gap:.85rem 1.5rem;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));margin:0}
.ti-defs--tight{gap:.5rem 1rem}
.ti-defs>div{margin:0}
.ti-defs__wide{grid-column:1 / -1}
.ti-defs dt{margin:0 0 .15rem;color:var(--ti-mute);font-size:.75rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.ti-defs dd{margin:0;color:var(--ti-navy-800);font-size:.93rem;line-height:1.5}

.ti-note{display:flex;gap:.75rem;align-items:flex-start;padding:1rem;margin:1.25rem 0;background:var(--ti-blue-100);border-radius:10px}
.ti-note svg{flex:0 0 20px;margin-top:2px;color:var(--ti-navy-700)}
.ti-note p{margin:0;color:var(--ti-navy-800);font-size:.86rem;line-height:1.6}

/* -------------------------------------------------------------- Lists --- */

.ti-list{list-style:none;margin:0;padding:0}
.ti-list li+li{border-top:1px solid var(--ti-gray-200)}
.ti-list a{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:.7rem 0;text-decoration:none}
.ti-list__ref{color:var(--ti-mute);font-family:ui-monospace,Consolas,monospace;font-size:.78rem}
.ti-list__title{flex:1 1 auto;color:var(--ti-navy-800);font-size:.9rem;font-weight:600}

.ti-notelist{list-style:none;margin:0;padding:0}
.ti-notelist li{padding:.75rem 0}
.ti-notelist li+li{border-top:1px solid var(--ti-gray-200)}
.ti-notelist a{text-decoration:none;display:block}
.ti-notelist strong{display:block;color:var(--ti-navy-800);font-size:.9rem;line-height:1.4}
.ti-notelist time{color:var(--ti-mute);font-size:.76rem}
.ti-notelist li.is-unread strong::before{content:"";display:inline-block;width:7px;height:7px;margin-right:.45rem;background:var(--ti-gold-500);border-radius:50%;vertical-align:middle}
.ti-notelist--full li{display:flex;gap:1rem;align-items:flex-start;justify-content:space-between}
.ti-notelist__body p{margin:.25rem 0;color:var(--ti-slate);font-size:.85rem}
.ti-notelist__actions{display:flex;gap:.5rem;align-items:center;flex:0 0 auto}

.ti-filelist{list-style:none;margin:.5rem 0 0;padding:0}
.ti-filelist li{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;padding:.55rem 0}
.ti-filelist li+li{border-top:1px solid var(--ti-gray-200)}
.ti-filelist a{display:inline-flex;gap:.5rem;align-items:center;font-size:.88rem;text-decoration:none}
.ti-filelist--tight li{padding:.3rem 0;border:0}

.ti-timeline{list-style:none;margin:0;padding:0 0 0 1.25rem;position:relative}
.ti-timeline::before{content:"";position:absolute;left:4px;top:6px;bottom:6px;width:2px;background:var(--ti-gray-200)}
.ti-timeline li{position:relative;padding:.5rem 0}
.ti-timeline__dot{position:absolute;left:-1.25rem;top:.85rem;width:10px;height:10px;background:var(--ti-navy-600);border-radius:50%}
.ti-timeline strong{display:block;color:var(--ti-navy-800);font-size:.9rem;font-weight:600}
.ti-timeline time{color:var(--ti-mute);font-size:.76rem}

/* ------------------------------------------------------------ Tables --- */

.ti-tablewrap{overflow-x:auto;border:1px solid var(--ti-gray-200);border-radius:14px;background:#fff;margin-bottom:1.25rem}
.ti-table{width:100%;border-collapse:collapse;min-width:640px}
.ti-table th,.ti-table td{padding:.85rem 1rem;text-align:left;vertical-align:top;font-size:.88rem}
.ti-table thead th{
	background:var(--ti-gray-100);color:var(--ti-mute);
	font-size:.73rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
	border-bottom:1px solid var(--ti-gray-200);
}
.ti-table tbody tr+tr{border-top:1px solid var(--ti-gray-200)}
.ti-table strong{color:var(--ti-navy-800)}
.ti-table__right{text-align:right}
.ti-sub{display:block;color:var(--ti-mute);font-size:.76rem;margin-top:.15rem}
.ti-mono{font-family:ui-monospace,Consolas,monospace;font-size:.82rem;color:var(--ti-slate)}

/* ------------------------------------------------------------ Badges --- */

.ti-badge{
	display:inline-block;padding:.25rem .6rem;border-radius:999px;
	font-size:.72rem;font-weight:700;letter-spacing:.03em;white-space:nowrap;
}
.ti-badge--ok{background:#E8F6EE;color:#1B5E38}
.ti-badge--bad{background:#FDECEC;color:#8C1D22}
.ti-badge--wait{background:var(--ti-gold-100);color:var(--ti-gold-600)}
.ti-badge--info{background:var(--ti-blue-100);color:var(--ti-navy-700)}
.ti-badge--muted{background:var(--ti-gray-100);color:var(--ti-mute)}

/* ------------------------------------------------------- Order track --- */

.ti-track{display:flex;flex-wrap:wrap;gap:.4rem;list-style:none;margin:0 0 1.5rem;padding:0}
.ti-track li{
	flex:1 1 120px;padding:.6rem .75rem;text-align:center;
	background:var(--ti-gray-100);border-radius:8px;
	color:var(--ti-mute);font-size:.78rem;font-weight:600;
}
.ti-track li.is-done{background:#E8F6EE;color:#1B5E38}
.ti-track li.is-current{background:var(--ti-navy-800);color:#fff}

/* ------------------------------------------------------- Quote cards --- */

.ti-quotes{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.ti-quote{padding:1.25rem;border:1px solid var(--ti-gray-200);border-top:3px solid var(--ti-gold-500);border-radius:12px;background:var(--ti-gray-100)}
.ti-quote__head{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;margin-bottom:.85rem}
.ti-quote__rank{color:var(--ti-gold-600);font-size:.73rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.ti-quote__value{color:var(--ti-navy-800);font-size:1.15rem;font-weight:800}
.ti-quote__note{margin:.75rem 0 0;color:var(--ti-slate);font-size:.83rem;line-height:1.55}
.ti-quote form{margin-top:1rem}

/* -------------------------------------------------------- Agreements --- */

.ti-agreement{
	padding:1.25rem;margin-bottom:1rem;max-height:460px;overflow-y:auto;
	background:var(--ti-gray-100);border:1px solid var(--ti-gray-200);border-radius:10px;
	font-size:.88rem;line-height:1.65;color:var(--ti-slate);
}
.ti-agreement h3,.ti-agreement h4{color:var(--ti-navy-800)}
.ti-agreement table{width:100%;border-collapse:collapse;margin:.75rem 0}
.ti-agreement th,.ti-agreement td{padding:.5rem .65rem;border:1px solid var(--ti-gray-300);text-align:left;vertical-align:top}
.ti-agreement th{width:38%;background:#fff;color:var(--ti-navy-800);font-size:.8rem}

.ti-signatures{list-style:none;margin:0 0 1.25rem;padding:0;display:grid;gap:.6rem}
.ti-signatures li{
	display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:space-between;
	padding:.75rem 1rem;border:1px solid var(--ti-gray-200);border-radius:10px;background:#fff;
}
.ti-signatures li.is-signed{border-color:#A8DCC0;background:#F2FAF5}
.ti-signatures__party{color:var(--ti-navy-800);font-size:.88rem;font-weight:600}
.ti-signatures__by{display:flex;flex-direction:column;text-align:right}
.ti-signatures__by strong{font-size:.85rem;color:var(--ti-navy-800)}
.ti-signatures__by span,.ti-signatures__by time{color:var(--ti-mute);font-size:.75rem}
.ti-signatures__pending{color:var(--ti-mute);font-size:.8rem;font-style:italic}
.ti-signform{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--ti-gray-200)}

/* ---------------------------------------------------------- Form bits --- */

.ti-card--form .ti-form{margin:0}
.ti-form__legend{
	margin:1.75rem 0 1rem;padding-top:1rem;border-top:1px solid var(--ti-gray-200);
	font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ti-gold-600);
}
.ti-form__legend:first-child{margin-top:0;padding-top:0;border-top:0}
.ti-form__foot{margin:1.25rem 0 0;text-align:center;color:var(--ti-slate);font-size:.87rem}
.ti-form__inline{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:space-between;margin-bottom:1rem}
.ti-form--inline{display:grid;gap:.75rem;grid-template-columns:1fr;align-items:end;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid var(--ti-gray-200)}
@media (min-width:700px){ .ti-form--inline{grid-template-columns:1fr 1fr auto} }
.ti-form--inline .ti-field{margin-bottom:0}

.ti-field__help{margin:.35rem 0 0;color:var(--ti-mute);font-size:.78rem;line-height:1.5}
.ti-inputgroup{display:flex;gap:.5rem}
/* The picker now shows the country name beside the code, so the closed
   control needs room for a name; it still gives the number field the
   larger share of the row. */
.ti-input--cc{flex:0 1 190px;min-width:0}
/* Currency codes are three characters; the dialling-code width was sized
   for "United Arab Emirates +971" and left the price field cramped. */
.ti-input--currency{flex:0 0 6.5rem;min-width:0}
@media (max-width:560px){.ti-input--currency{flex:0 0 5.5rem}}
@media (max-width:560px){.ti-inputgroup{flex-wrap:wrap}.ti-input--cc{flex:1 1 100%}}
.ti-input--file{padding:.55rem .75rem;background:var(--ti-gray-100)}
.ti-check--tight{margin-bottom:0}
.ti-linkbtn{
	background:none;border:0;padding:0;cursor:pointer;
	color:var(--ti-blue-500);font-family:inherit;font-size:.85rem;
	text-decoration:underline;text-underline-offset:3px;
}
.ti-linkbtn:hover{color:var(--ti-navy-700)}
.ti-forgot{margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid var(--ti-gray-200)}
.ti-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
