/* ============================================================
   Bereket Emeklilik — Fon Operasyon Uygulaması
   ============================================================ */

:root {
  --primary: #0f2a47;
  --primary-light: #1a3a5c;
  --primary-dark: #081a2e;
  --accent: #c9a961;
  --accent-dark: #a88a47;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0ea5e9;
  --info-bg: #f0f9ff;

  --bg: #f1f5f9;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, .1), 0 4px 6px -4px rgba(15, 23, 42, .05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, .1), 0 8px 10px -6px rgba(15, 23, 42, .06);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --sidebar-w: 260px;
  --header-h: 64px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

#loginScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
}

.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.login-tabs button {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .2s;
}

.login-tabs button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  transition: all .2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 42, 71, .1);
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
  display: none;
}

.form-error.show { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

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

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

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border-strong); }

.btn-icon {
  padding: 8px;
  width: 36px; height: 36px;
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

/* ============================================================
   APP LAYOUT
   ============================================================ */

#app { display: none; }
#app.show { display: block; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

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

.sidebar-brand .icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 700;
}

.sidebar-brand .title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.sidebar-brand .subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, .6);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .4);
  padding: 14px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 2px;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .06);
  color: white;
}

.nav-item.active {
  background: rgba(201, 169, 97, .15);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-info { flex: 1; min-width: 0; }
.user-info .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .role {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
}

.btn-logout {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .6);
  transition: all .15s;
}
.btn-logout:hover { background: rgba(239, 68, 68, .15); color: var(--danger); }

/* ----- Main ----- */
.main {
  background: var(--bg);
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
}

.topbar .page-title .sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 8px;
}

.topbar-search {
  position: relative;
  width: 320px;
}
.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 13px;
  outline: none;
  transition: all .15s;
}
.topbar-search input:focus {
  background: var(--surface);
  border-color: var(--primary);
}
.topbar-search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: .5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-muted);
}
.topbar-date .day { font-weight: 700; color: var(--primary); font-size: 13px; }

.content {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

/* ============================================================
   COMPONENTS
   ============================================================ */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .icon { font-size: 24px; }
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----- Stat tiles ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-tile::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color, var(--primary));
}

.stat-tile .label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 8px;
}

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

.stat-tile .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-tile.success { --accent-color: var(--success); }
.stat-tile.warning { --accent-color: var(--warning); }
.stat-tile.danger  { --accent-color: var(--danger); }
.stat-tile.info    { --accent-color: var(--info); }

/* ----- Progress bar ----- */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 999px;
  transition: width .4s;
}
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-primary { background: rgba(15, 42, 71, .08); color: var(--primary); }

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

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

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

.fund-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}

.fund-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.fund-card .fund-strip {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--fund-color, var(--primary));
}

.fund-card .fund-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.fund-card .fund-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--fund-color, var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.fund-card .fund-meta { flex: 1; min-width: 0; }
.fund-card .fund-code {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: .04em;
}
.fund-card .fund-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fund-card .fund-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-left: 8px;
}
.fund-card .fund-progress .pct { font-weight: 700; color: var(--primary); }

.fund-card .fund-manager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 6px 0 10px 8px;
  background: color-mix(in srgb, var(--mgr-color, #64748b) 10%, transparent);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.fund-card .fund-manager .mgr-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mgr-color);
  flex-shrink: 0;
}
.fund-card .fund-manager .mgr-name { color: var(--mgr-color); }
.fund-card .fund-manager .mgr-arrow { color: var(--text-muted); font-weight: 400; }
.fund-card .fund-manager .mgr-pending {
  color: var(--warning);
  font-weight: 700;
  font-size: 10px;
}

.fund-card .fund-transfer-flag {
  position: absolute;
  top: 8px; right: 10px;
  background: var(--warning);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.fund-card .fund-transfer-flag.upcoming-flag {
  background: var(--accent);
  color: var(--primary-dark);
}

.fund-card.upcoming {
  background: linear-gradient(135deg, #fffbeb 0%, var(--surface) 50%);
  border-color: var(--accent);
  border-style: dashed;
}

.mgr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.mgr-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mgr-color);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.mgr-summary-icon {
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--mgr-color) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.mgr-summary-body { flex: 1; min-width: 0; }
.mgr-summary-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--mgr-color);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mgr-summary-count {
  font-size: 13px;
  color: var(--text);
  margin-top: 2px;
}
.mgr-summary-count strong { font-size: 16px; font-weight: 700; color: var(--primary); }

/* Browsers without color-mix() fall back to subtle background */
@supports not (background: color-mix(in srgb, red, blue)) {
  .fund-card .fund-manager { background: rgba(0, 0, 0, .04); }
}

/* ============================================================
   WORKFLOW VIEW
   ============================================================ */

.workflow-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.date-selector input[type="date"] {
  border: none;
  padding: 6px 10px;
  background: transparent;
  outline: none;
  font-weight: 600;
  color: var(--primary);
}
.date-selector button {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
}
.date-selector button:hover { background: var(--bg); color: var(--primary); }

.fund-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.fund-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.fund-tab .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fund-color, var(--primary));
}

.fund-tab .progress-mini {
  background: var(--bg);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.fund-tab.complete .progress-mini { background: var(--success-bg); color: var(--success); }
.fund-tab.partial .progress-mini { background: var(--warning-bg); color: var(--warning); }

.fund-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.fund-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.fund-tab.active .progress-mini { background: rgba(255,255,255,.2); color: white; }

.workflow-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.workflow-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.workflow-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--group-color, var(--primary)) 0%, var(--group-color, var(--primary)) 4px, var(--bg-soft) 4px, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.workflow-group-header .group-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid var(--border);
}

.workflow-group-header .group-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
}

.workflow-group-header .group-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.workflow-group-header .group-toggle {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform .2s;
}
.workflow-group.collapsed .group-toggle { transform: rotate(-90deg); }
.workflow-group.collapsed .workflow-steps { display: none; }

.workflow-steps {
  padding: 8px;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  cursor: pointer;
}
.step-row:hover { background: var(--bg-soft); }

.step-row.done { background: var(--success-bg); }
.step-row.done .step-label { color: var(--text-muted); text-decoration: line-through; }

.step-checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .15s;
}

.step-row.done .step-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-content { flex: 1; min-width: 0; }
.step-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-light);
}

.step-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.step-row:hover .step-actions { opacity: 1; }

.step-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .15s;
}
.step-action-btn:hover { background: var(--surface); color: var(--primary); }

.step-note {
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  margin-top: 6px;
  font-style: italic;
}

.step-template-note {
  background: rgba(201, 169, 97, .1);
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  margin-top: 6px;
}

.step-time-badge {
  display: inline-block;
  background: var(--bg-soft);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  border: 1px solid var(--border);
}
.step-crit-badge {
  display: inline-block;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: .04em;
}
.step-row.critical .step-checkbox { border-color: var(--danger); }

/* ============================================================
   NOTES VIEW
   ============================================================ */

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

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

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

.note-card.pinned {
  background: linear-gradient(135deg, #fffbeb 0%, var(--surface) 30%);
  border-color: var(--accent);
}

.note-card .note-pin {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 14px;
  color: var(--accent-dark);
}

.note-card .note-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  padding-right: 24px;
}

.note-card .note-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.note-card .note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.note-card .note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15, 42, 71, .08);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ============================================================
   ISSUES VIEW
   ============================================================ */

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--issue-color, var(--text-muted));
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

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

.issue-priority {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  color: var(--issue-color);
  font-weight: 700;
  min-width: 36px;
}
.issue-priority .label {
  font-size: 9px;
  margin-top: 2px;
  letter-spacing: .03em;
}

.issue-body { min-width: 0; }
.issue-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.issue-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.issue-status {
  text-align: center;
  white-space: nowrap;
}

/* ============================================================
   ACTIVITY / TIMELINE
   ============================================================ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 10px 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-item .item-text {
  font-size: 13px;
  color: var(--text);
}

.timeline-item .item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   TABLE
   ============================================================ */

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

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

table.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 12px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

table.data-table tr:hover td {
  background: var(--bg-soft);
}

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

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .2s;
}

.modal.lg { max-width: 800px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-soft);
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--bg); color: var(--danger); }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Form inside modal must propagate flex so body scrolls and footer stays visible */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-soft);
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .4;
}
.empty .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.empty .desc { font-size: 13px; }

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================================
   TOAST
   ============================================================ */

#toastContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideIn .25s;
  font-size: 13px;
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast .icon { font-size: 16px; }
.toast .body { flex: 1; }
.toast .title { font-weight: 700; color: var(--primary); }
.toast .msg { color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   LOADING
   ============================================================ */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 42, 71, .2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner.lg { width: 32px; height: 32px; border-width: 3px; }
.spinner.white { border-color: rgba(255,255,255,.3); border-top-color: white; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

/* ============================================================
   CALENDAR
   ============================================================ */

.calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.calendar-head h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day-name {
  text-align: center;
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.calendar-day {
  min-height: 90px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.calendar-day:hover { background: var(--bg-soft); }
.calendar-day.other-month { color: var(--text-light); background: var(--bg); }
.calendar-day.today { background: rgba(201, 169, 97, .08); }
.calendar-day.today .day-num { color: var(--accent-dark); font-weight: 700; }

.calendar-day .day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.calendar-day .day-progress {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.calendar-day .day-progress .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.calendar-day .day-progress .dot.partial { background: var(--warning); }
.calendar-day .day-progress .dot.empty { background: var(--border); }

.calendar-day .day-stat {
  position: absolute;
  bottom: 6px; right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ============================================================
   FUND DETAIL PANEL
   ============================================================ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-grid > div {
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.detail-grid .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.detail-grid .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

/* ============================================================
   TASKS
   ============================================================ */

.task-group {
  margin-bottom: 18px;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.task-group-header .count {
  background: var(--bg-soft);
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--text);
  font-size: 11px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--task-color, var(--text-muted));
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  transition: all .15s;
  position: relative;
  cursor: pointer;
}

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

.task-card.done {
  opacity: .55;
  background: var(--bg-soft);
}
.task-card.done .task-title { text-decoration: line-through; }

.task-card.overdue {
  background: linear-gradient(90deg, var(--danger-bg) 0%, var(--surface) 50%);
  border-left-color: var(--danger);
}

.task-card.due-today {
  background: linear-gradient(90deg, var(--warning-bg) 0%, var(--surface) 50%);
  border-left-color: var(--warning);
}

.task-card.critical {
  border-left-width: 5px;
}
.task-card.critical::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent var(--danger) transparent transparent;
}

.task-checkbox {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}

.task-card.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.task-body { min-width: 0; }

.task-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-title .cat-icon {
  font-size: 14px;
}

.task-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
}

.task-meta .pill {
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-meta .pill.scope-fund {
  background: rgba(15, 42, 71, .08);
  color: var(--primary);
}

.task-meta .pill.recur {
  background: rgba(124, 58, 237, .1);
  color: #7c3aed;
}

.task-due {
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
  min-width: 110px;
}
.task-due .date {
  font-weight: 700;
  color: var(--primary);
}
.task-due .time {
  color: var(--text-muted);
  font-size: 11px;
}
.task-due .countdown {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--text-muted);
  display: inline-block;
}
.task-due .countdown.urgent {
  background: var(--warning-bg);
  color: var(--warning);
}
.task-due .countdown.overdue {
  background: var(--danger-bg);
  color: var(--danger);
}
.task-due .countdown.done {
  background: var(--success-bg);
  color: var(--success);
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.task-card:hover .task-actions { opacity: 1; }

.task-priority {
  font-size: 16px;
}

/* Weekday picker */
.weekday-picker .wd {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.weekday-picker .wd:hover { border-color: var(--primary); }
.weekday-picker .wd.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Fund checklist */
.fund-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.fund-check-row:hover { background: var(--bg); }
.fund-check-row input[type=checkbox] { margin: 0; }
.fund-check-row .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* Template card */
.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--task-color);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.template-card .body { min-width: 0; }
.template-card .title {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 2px;
}
.template-card .desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.4;
}
.template-card .meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Critical task in dashboard */
.crit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.crit-row:hover { background: var(--bg-soft); }
.crit-row:last-child { border-bottom: none; }
.crit-row .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.crit-row .info { flex: 1; min-width: 0; }
.crit-row .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crit-row .when {
  font-size: 11px;
  color: var(--text-muted);
}
.crit-row .badge { flex-shrink: 0; }

/* Pulse for critical */
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.task-card.critical.overdue .task-checkbox {
  animation: pulseRed 2s infinite;
}

/* Calendar task pill */
.calendar-day .day-tasks {
  position: absolute;
  top: 28px; left: 6px; right: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 50px;
}
.calendar-day .task-pill {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--info-bg);
  color: var(--info);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid var(--info);
}
.calendar-day .task-pill.critical { background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.calendar-day .task-pill.high { background: var(--warning-bg); color: var(--warning); border-left-color: var(--warning); }
.calendar-day .task-pill.done { opacity: .5; text-decoration: line-through; }

/* Empty filter results */
.task-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ============================================================
   ROUTINES (Rutin İşler) + EDITABLE WORKFLOW SETTINGS
   ============================================================ */

.rtn-section {
  margin-bottom: 24px;
}
.rtn-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}
.rtn-section-head .icon { font-size: 16px; }
.rtn-section-head .count { margin-left: auto; background: var(--bg-soft); padding: 2px 8px; border-radius: 999px; }

.rtn-row {
  display: grid;
  grid-template-columns: 80px 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rtn-color, var(--primary));
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.rtn-row:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.rtn-row.done { opacity: .55; background: var(--bg-soft); }
.rtn-row.done .rtn-title { text-decoration: line-through; }
.rtn-row.critical { border-left-width: 5px; }
.rtn-row.now { box-shadow: 0 0 0 2px var(--accent); }

.rtn-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  text-align: right;
}
.rtn-time .ampm { font-size: 10px; color: var(--text-muted); display: block; margin-top: 1px; font-weight: 500; }

.rtn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: color-mix(in srgb, var(--rtn-color) 15%, transparent);
}

.rtn-body { min-width: 0; }
.rtn-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rtn-title .crit-flag { color: var(--danger); font-size: 12px; }
.rtn-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}
.rtn-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.rtn-meta .pill {
  background: var(--bg-soft);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.rtn-meta .pill.source-workflow { color: var(--info); background: var(--info-bg); }
.rtn-meta .pill.source-task     { color: var(--primary); }
.rtn-meta .pill.source-procedure { color: #7c3aed; background: rgba(124,58,237,.1); }

.rtn-toggle-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.rtn-toggle-btn:hover {
  border-color: var(--success);
  color: var(--success);
  transform: scale(1.03);
}
.rtn-toggle-btn.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.rtn-toggle-btn.done:hover {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border-strong);
}

.rtn-progress {
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}
.rtn-progress .pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.rtn-progress .small {
  font-size: 10px;
  color: var(--text-muted);
}
.rtn-progress .progress { width: 80px; margin-top: 4px; }

.rtn-notes-popout {
  margin-top: 6px;
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-style: italic;
  color: var(--text);
  white-space: pre-wrap;
}

/* === EDITABLE WORKFLOW SETTINGS === */
.wfedit-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.wfedit-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.wfedit-group-head .icon-box {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: color-mix(in srgb, var(--wfg-color) 18%, transparent);
}
.wfedit-group-head .name {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  flex: 1;
}
.wfedit-group-head .step-count { font-size: 11px; color: var(--text-muted); background: var(--surface); padding: 2px 8px; border-radius: 999px; }
.wfedit-group-head .toggle { font-size: 12px; color: var(--text-muted); transition: transform .2s; }
.wfedit-group.collapsed .toggle { transform: rotate(-90deg); }
.wfedit-group.collapsed .wfedit-steps { display: none; }

.wfedit-step {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.wfedit-step:last-child { border-bottom: none; }
.wfedit-step-head {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 10px;
  padding: 10px 16px;
  align-items: center;
  cursor: pointer;
  transition: background .15s;
}
.wfedit-step-head:hover { background: var(--bg-soft); }
.wfedit-step-head .step-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
}
.wfedit-step-head .step-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wfedit-step-head .crit-pill {
  font-size: 9px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.wfedit-step-head .has-notes-pill {
  font-size: 10px;
  color: var(--info);
}
.wfedit-step-head .step-expand { font-size: 12px; color: var(--text-muted); transition: transform .2s; }
.wfedit-step.expanded .step-expand { transform: rotate(180deg); }

.wfedit-step-detail {
  display: none;
  padding: 12px 16px 16px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.wfedit-step.expanded .wfedit-step-detail { display: block; }

.wfedit-fields {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 10px;
  margin-bottom: 10px;
}
.wfedit-fields .field-block label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
  display: block;
  margin-bottom: 4px;
}
.wfedit-fields input[type="text"],
.wfedit-fields input[type="time"],
.wfedit-fields textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.wfedit-fields input[type="time"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}
.wfedit-fields input:focus,
.wfedit-fields textarea:focus { border-color: var(--primary); }
.wfedit-fields textarea { resize: vertical; min-height: 60px; }

.wfedit-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.wfedit-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.wfedit-toolbar label.crit-on {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}
.wfedit-saved-indicator {
  margin-left: auto;
  font-size: 11px;
  color: var(--success);
  opacity: 0;
  transition: opacity .25s;
  font-weight: 700;
}
.wfedit-saved-indicator.show { opacity: 1; }

.wfedit-add-step-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-top: 1px dashed var(--border);
  cursor: pointer;
  transition: all .15s;
}
.wfedit-add-step-btn:hover {
  background: var(--bg-soft);
  color: var(--accent-dark);
}

.wfedit-step.custom .wfedit-step-head { background: rgba(201, 169, 97, .04); }

.wfedit-step.hidden-step .wfedit-step-head {
  background: var(--danger-bg);
  opacity: .7;
}
.wfedit-step.hidden-step .wfedit-step-head .step-label {
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.wfedit-group.hidden-group {
  opacity: .65;
  border: 2px dashed var(--danger);
}
.wfedit-group.hidden-group .wfedit-group-head {
  background: var(--danger-bg);
}
.wfedit-group.hidden-group .wfedit-group-head .name {
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.wfedit-step.custom .wfedit-step-head .step-label::before {
  content: "★";
  color: var(--accent-dark);
  margin-right: 4px;
  font-size: 11px;
}
.wfedit-group.custom .wfedit-group-head .name::before {
  content: "★ ";
  color: var(--accent-dark);
}

.wfedit-scope-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.wfedit-scope-row select {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.wfedit-fund-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 10px;
  display: none;
}
.wfedit-fund-pick-list.show { display: flex; }

.wf-fund-pick {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.wf-fund-pick:hover { border-color: var(--primary); }
.wf-fund-pick.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.wfedit-delete-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.wfedit-delete-btn:hover {
  background: var(--danger);
  color: white;
}

.scope-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--text-muted);
  margin-left: 4px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.scope-pill.scope-specific { background: rgba(15, 42, 71, .08); color: var(--primary); }
.scope-pill.scope-general { background: rgba(245, 158, 11, .12); color: var(--warning); }

@media (max-width: 700px) {
  .rtn-row { grid-template-columns: 70px 28px 1fr; }
  .rtn-progress { grid-column: 1/-1; text-align: left; }
  .wfedit-fields { grid-template-columns: 1fr; }
}

/* ============================================================
   TRANSFER TEMPLATES (Talimat Şablonları)
   ============================================================ */

.tt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tt-color, var(--primary));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.tt-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.tt-card .tt-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.tt-card .tt-card-flow {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tt-card .tt-card-flow .from {
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
}
.tt-card .tt-card-flow .to {
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
}
.tt-card .tt-card-flow .arrow { color: var(--text-muted); }
.tt-card .tt-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.tt-card .tt-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tt-fromto {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.tt-fromto-block {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.tt-fromto-block .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.tt-fromto-block .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}
.tt-fromto-arrow {
  font-size: 24px;
  color: var(--accent-dark);
  font-weight: 700;
}

.tt-table th {
  font-size: 11px;
  white-space: nowrap;
}
.tt-table td {
  vertical-align: middle;
  font-size: 13px;
}
.tt-table .tt-amount-input {
  width: 100%;
  max-width: 200px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.tt-table .tt-amount-input:focus { border-color: var(--primary); }
.tt-table .tt-amount-input:disabled {
  background: var(--bg-soft);
  color: var(--text-light);
  cursor: not-allowed;
}
.tt-table tr.tt-selected { background: rgba(201, 169, 97, .06); }
.tt-table tr.tt-selected td { font-weight: 600; }
.tt-table .tt-fund-cell {
  white-space: nowrap;
  font-weight: 700;
}
.tt-table .tt-cell-static {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text);
}

.tt-edit-col-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tt-edit-col-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.tt-edit-col-row input:focus { border-color: var(--primary); }
.tt-edit-col-row .key { max-width: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tt-edit-col-row button {
  background: transparent;
  color: var(--danger);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-edit-col-row button:hover { background: var(--danger-bg); }

.tt-edit-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}
.tt-edit-row .tt-edit-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tt-edit-row .tt-edit-row-head select,
.tt-edit-row .tt-edit-row-head input {
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.tt-edit-row .tt-edit-row-head select { width: 130px; }
.tt-edit-row .tt-edit-row-head .fund-label {
  font-weight: 700;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.tt-edit-row .tt-edit-row-head button {
  margin-left: auto;
  color: var(--danger);
  width: 28px; height: 28px;
  border-radius: 6px;
}
.tt-edit-row .tt-edit-row-head button:hover { background: var(--danger-bg); }
.tt-edit-row .tt-edit-row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}
.tt-edit-row .tt-edit-row-fields input {
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tt-edit-row .tt-edit-row-fields input:focus { border-color: var(--primary); }
.tt-edit-row .tt-edit-row-fields .field-wrap label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

#ttPreview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#ttPreview th, #ttPreview td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
#ttPreview th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--primary);
}
#ttPreview td:last-child { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }

/* ============================================================
   FUND-INSIDE — Inside Fund Watcher
   ============================================================ */

.fi-table td .code-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
  letter-spacing: .04em;
}

.fi-table .price-cell {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  white-space: nowrap;
}
.fi-table .price-cell.loading { color: var(--text-muted); font-weight: 500; font-style: italic; }
.fi-table .price-cell.error { color: var(--danger); font-style: italic; font-size: 12px; }

.fi-name {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.fi-name .sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.fi-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.btn-copy {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn-copy:hover { background: var(--accent-dark); color: white; }
.btn-copy:disabled { opacity: .5; cursor: not-allowed; }
.btn-copy.copied {
  background: var(--success);
  color: white;
}

.btn-row-action {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .15s;
}
.btn-row-action:hover { background: var(--bg); color: var(--primary); }
.btn-row-action.danger:hover { background: var(--danger-bg); color: var(--danger); }

.fi-row.error {
  background: var(--danger-bg);
}

.fi-row td {
  vertical-align: middle;
}

.fi-update-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Toast for copy */
.toast.copy {
  border-left-color: var(--accent);
}

/* ============================================================
   PROCEDURES (SOP)
   ============================================================ */

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

.proc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--proc-color, var(--primary));
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.proc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.proc-card .proc-badge-library {
  position: absolute;
  top: 10px; right: 44px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(201, 169, 97, .15);
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.proc-card .proc-edit-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  z-index: 2;
}
.proc-card .proc-edit-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.proc-card .proc-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--proc-color);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.proc-card .proc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.3;
  padding-right: 60px;
}
.proc-card .proc-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  flex: 1;
}
.proc-card .proc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.proc-card .proc-meta .pill {
  background: var(--bg-soft);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text-muted);
}
.proc-card .proc-meta .pill.system {
  background: rgba(15, 42, 71, .06);
  color: var(--primary);
}
.proc-card .proc-meta .pill.fund {
  font-weight: 700;
  color: var(--text);
}
.proc-card .proc-meta .pill.freq {
  background: var(--info-bg);
  color: var(--info);
}
.proc-card .proc-meta .pill.steps {
  background: var(--success-bg);
  color: var(--success);
}

.proc-section {
  margin-bottom: 24px;
}
.proc-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--proc-color);
  margin-bottom: 12px;
}
.proc-section-header .count {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Procedure detail modal */
.proc-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.proc-detail-meta > div {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.proc-detail-meta .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.proc-detail-meta .value {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

.proc-systems-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.proc-systems-pills .system-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border-left: 3px solid var(--sys-color, var(--primary));
}

.proc-funds-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.proc-funds-pills .fund-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--fund-color);
  color: var(--fund-color);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.proc-detail-summary {
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}

.proc-steps {
  list-style: none;
  counter-reset: stepc;
  padding: 0;
}
.proc-steps li {
  counter-increment: stepc;
  position: relative;
  padding: 10px 12px 10px 44px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.proc-steps li::before {
  content: counter(stepc);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Procedure fund picker (compact pills) */
.proc-fund-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.proc-fund-pick:hover { border-color: var(--primary); }
.proc-fund-pick.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: -100%;
    width: 280px;
    height: 100vh;
    z-index: 100;
    transition: left .25s;
  }
  .sidebar.open { left: 0; }
  .topbar-search { width: auto; flex: 1; max-width: 200px; }
  .content { padding: 16px; }
  .menu-toggle { display: flex !important; }
  .task-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .task-due {
    grid-column: 2;
    text-align: left;
    min-width: 0;
  }
  .task-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    opacity: 1;
    justify-content: flex-end;
  }
}

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--primary);
}
.menu-toggle:hover { background: var(--bg); }

/* ============================================================
   UTILITIES
   ============================================================ */

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }

.hidden { display: none !important; }
