/* Workshark component stylesheet (components/bundle.css from the Workshark Design System), unchanged. */
/* Workshark component stylesheet.
   The class components of app/globals.css, the Stock and Additional-fees page sheets, and the inline
   styles of Sidebar.js, Modal.js, GlobalNotification.js and research/ui.js, rewritten onto the tokens
   in tokens.json. Load tokens.css first and Inter from Google Fonts; this file then stands in for
   globals.css. Values are the source's; the two deliberate changes are marked "system:". */

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

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; }
.container { max-width: var(--container-max); margin: 0 auto; padding: var(--space-8); }
.grid-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); margin-bottom: var(--space-8); }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-6); }
@media (max-width: 1024px) { .grid-main { grid-template-columns: 1fr; } }

/* Element type, as globals.css sets it */
h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
h2 { font-size: 1.5rem; font-weight: 600; margin: 0 0 var(--space-4); }
h3 { font-size: 1.25rem; font-weight: 500; margin: 0; color: var(--text-secondary); }
p { margin: 0; line-height: 1.6; color: var(--text-secondary); }
a { color: inherit; text-decoration: none; }

/* Sidebar (components/Sidebar.js) */
.sidebar { width: var(--sidebar-width); background: var(--bg-glass); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; position: fixed; height: 100vh; left: 0; top: 0; z-index: var(--z-sidebar); padding: var(--space-8) var(--space-6); }
.sidebar-logo { font-size: 1.25rem; font-weight: 700; margin-bottom: var(--space-12); display: flex; align-items: center; gap: var(--space-3); color: var(--text-primary); }
.sidebar-logo svg { color: var(--accent-primary); }
.sidebar-nav { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; overflow-y: auto; margin-bottom: var(--space-4); padding-right: var(--space-2); }
.nav-item { display: flex; align-items: center; gap: var(--space-4); width: 100%; padding: 0.875rem var(--space-4); border-radius: var(--radius-lg); color: var(--text-secondary); font: inherit; font-weight: 500; text-align: left; background: none; border: none; cursor: pointer; transition: all 0.2s ease; }
.nav-item:hover { background: var(--white-5); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, var(--primary-tint-strong), var(--secondary-tint-strong)); color: var(--accent-primary); border: 1px solid var(--primary-border); }
.nav-item svg { flex-shrink: 0; }
.nav-item.logout { color: var(--accent-danger); }
.sidebar-footer { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--glass-border); }

/* Page header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); padding-bottom: var(--space-4); border-bottom: 1px solid var(--glass-border); }
.header-actions { display: flex; gap: var(--space-4); }

/* Glass card */
.glass-card { background: var(--bg-glass); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); border: 1px solid var(--glass-border); border-radius: var(--border-radius); padding: var(--space-6); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.glass-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); border-color: var(--white-20); }

/* Fee card (additional-fees.css): the opaque card variant, used together with .glass-card */
.fee-card { position: relative; background: var(--bg-surface); border: 1px solid var(--white-5); transition: transform 0.2s, box-shadow 0.2s; }
.fee-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-fee-card-hover); }
.fee-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-4); }
.fee-header h3 { margin: 0; font-size: 1.1rem; font-weight: 500; }
.fee-type { text-transform: capitalize; font-size: 0.75rem; background: var(--white-10); padding: var(--space-1) var(--space-2); border-radius: var(--radius-xs); }
.fee-amount { font-size: 1.8rem; font-weight: 600; color: var(--accent-primary); }
.currency { font-size: 1rem; color: var(--text-secondary); font-weight: normal; }

/* Stats (KPI cards) */
.stat-item { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-header { display: flex; justify-content: space-between; align-items: center; }
.stat-icon { padding: var(--space-2); border-radius: var(--radius-md); display: inline-flex; }
.stat-icon.success { background: var(--success-tint); color: var(--accent-success); }
.stat-icon.primary { background: var(--primary-tint); color: var(--accent-primary); }
.stat-icon.secondary { background: var(--secondary-tint); color: var(--accent-secondary); }
.stat-value { font-size: 2rem; font-weight: 700; background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-trend { display: flex; align-items: center; gap: var(--space-2); font-size: 0.875rem; font-weight: 500; }
.trend-up { color: var(--accent-success); }
.trend-down { color: var(--accent-danger); }

/* Buttons */
/* system: the bare .btn has no fill or colour in the source (browser default); here it is transparent and inherits. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); font-family: inherit; font-weight: 600; font-size: 0.875rem; border: none; background: transparent; color: inherit; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #ffffff; box-shadow: var(--shadow-primary-btn); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-btn-hover); }
.btn-secondary { background: var(--white-5); color: var(--text-primary); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: var(--white-10); transform: translateY(-2px); }
.btn-danger { background: var(--danger-tint); color: var(--accent-danger); border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger-border); transform: translateY(-2px); }
/* the login page's link to the investor portal, and the Orders toolbar's sky outline */
.btn-outline { background: transparent; border: 1px solid var(--accent-primary); color: var(--accent-primary); font-weight: 400; font-size: 0.9rem; padding: var(--space-3); }
.btn-outline-info { border-color: var(--info-border); color: var(--accent-info); }
.btn-icon { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; width: 32px; height: 32px; border-radius: var(--radius-circle); display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-icon:hover { color: var(--accent-danger); background: var(--danger-tint); }

/* View toggle (stock.css) */
.view-toggle { display: inline-flex; background: var(--white-5); border-radius: var(--radius-md); padding: var(--space-1); }
.toggle-btn { background: transparent; border: none; color: var(--text-secondary); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 500; transition: all 0.2s ease; }
.toggle-btn:hover { color: var(--text-primary); }
.toggle-btn.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-toggle); }

/* Table */
.table-card { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { color: var(--text-secondary); font-weight: 500; padding: var(--space-4); border-bottom: 1px solid var(--glass-border); }
.data-table td { padding: var(--space-4); border-bottom: 1px solid var(--white-5); color: var(--text-primary); }
.data-table tr:hover td { background: var(--white-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .mono { font-family: var(--font-mono); font-size: 0.85rem; }

/* Badges */
.badge { display: inline-block; padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; }
.badge-success { background: var(--success-tint); color: var(--accent-success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-tint); color: var(--accent-warning); border: 1px solid var(--warning-border); }
/* badge-danger and badge-info have no rule in globals.css; these are the inline styles Orders and Businesses give them */
.badge-danger { background: var(--danger-tint); color: var(--accent-danger); border: 1px solid var(--danger-border); }
.badge-info { background: var(--primary-tint); color: var(--accent-primary); }
/* Stock page variants (stock.css): larger, no border, lighter greens */
.badge.success { font-size: 0.875rem; background: var(--success-tint-alt); color: var(--success-light); }
.badge.danger { font-size: 0.875rem; background: rgba(239, 68, 68, 0.2); color: var(--danger-text); }
.badge.neutral { font-size: 0.875rem; background: var(--neutral-tint); color: var(--neutral); }
/* Research chip (research/ui.js chipStyle) */
.badge.chip { background: rgba(59, 130, 246, 0.12); color: var(--primary-text); border: 1px solid rgba(59, 130, 246, 0.25); font-size: 0.72rem; }

/* Modal (components/Modal.js) */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay-scrim); backdrop-filter: blur(var(--blur-overlay)); -webkit-backdrop-filter: blur(var(--blur-overlay)); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); }
.modal-content { background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--border-radius); width: 100%; max-width: var(--modal-max); padding: var(--space-6); box-shadow: var(--shadow-modal); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.modal-title { font-size: 1.25rem; font-weight: 600; margin: 0; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: var(--space-2); border-radius: var(--radius-circle); display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.modal-close:hover { background: var(--white-10); color: var(--text-primary); }
.modal-body { display: flex; flex-direction: column; gap: var(--space-4); }
.modal-footer { padding-top: var(--space-6); border-top: 1px solid var(--glass-border); display: flex; justify-content: flex-end; gap: var(--space-4); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.form-input { width: 100%; background: var(--input-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); color: var(--text-primary); font-family: inherit; font-size: 1rem; transition: all 0.2s ease; }
.form-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: var(--focus-ring); }
textarea.form-input { min-height: 90px; resize: vertical; }
select.form-input { color-scheme: dark; }
select.form-input option { background: var(--bg-secondary); color: var(--text-primary); }
.form-hint { font-size: 0.75rem; color: var(--text-secondary); }
.form-error { font-size: 0.85rem; color: var(--danger-text); }
.error-banner { background: var(--danger-tint); color: var(--accent-danger); padding: var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-6); border: 1px solid var(--danger-border); }

/* Notification popup (components/GlobalNotification.js) */
/* system: the bell is coloured accent-primary; the source asks for --accent, which is undefined. */
.notification { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100% - 40px); max-width: 700px; z-index: var(--z-notification); padding: var(--space-8) var(--space-12); cursor: pointer; background: var(--bg-glass); backdrop-filter: blur(var(--blur-glass)); -webkit-backdrop-filter: blur(var(--blur-glass)); border: 1px solid var(--glass-border); border-left: 8px solid var(--accent-primary); border-radius: var(--border-radius); box-shadow: var(--shadow-notification); color: var(--text-primary); }
.notification-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-4); }
.notification-title { margin: 0; display: flex; align-items: center; gap: var(--space-4); color: var(--text-primary); font-size: 1.5rem; font-weight: 700; }
.notification-title svg { color: var(--accent-primary); flex-shrink: 0; }
.notification-message { margin: 0 0 var(--space-8); font-size: 1.25rem; color: var(--text-secondary); line-height: 1.5; }
.notification-foot { display: flex; justify-content: space-between; align-items: center; }
.notification-meta { font-size: 1rem; color: var(--text-secondary); }
.notification-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0; display: flex; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.animate-fade-in { animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.slide-down { animation: slideDown 0.3s ease-out; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin, .animate-spin { animation: spin 1s linear infinite; }
