/* ==========================================================================
   GOED Project Design System — warm red/charcoal for an interior contractor
   Palette: GOED red + warm charcoal base + soft neutral surfaces
   Type: Manrope (display) / Inter (body) / JetBrains Mono (data)
   ========================================================================== */

:root {
  --sidebar-width: 264px;

  /* Ink scale — deep charcoal derived from brand red for dark panels/text */
  --ink-950: #1C1112;
  --ink-900: #2A1A1C;
  --ink-800: #3A2528;
  --ink-700: #3b3033;
  --ink-500: #7a6f72;
  --ink-300: #cfc4c6;
  --ink-100: #EFEFEF;

  /* Surfaces — light gray page bg, white cards, gray borders */
  --surface: #F7F7F7;
  --card: #ffffff;
  --border: #E8E8E8;
  --border-dark: rgba(255,255,255,.09);

  /* Signal palette */
  --signal: #B3122B;
  --signal-dark: #8F0E22;
  --signal-glow: rgba(179, 18, 43, .35);
  /* Lighter tint used ONLY where blue sits on a dark panel (sidebar, dark
     avatar badges) — the base --signal is too close in luminance to the
     dark ink backgrounds to read clearly there. Never used on light
     surfaces, where --signal already has plenty of contrast. */
  --signal-on-dark: #F2A1AC;
  --amber: #F18F01;
  --danger: #f0453f;
  --success: #16b378;
  --info: #3b82f6;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(8, 13, 26, .05);
  --shadow-md: 0 10px 30px rgba(8, 13, 26, .08);
  --shadow-glow: 0 0 0 3px var(--signal-glow);
}

* { box-sizing: border-box; }

body {
  background: var(--surface);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
}

h1, h2, h3, h4, h5, h6, .display-font {
  font-family: 'Manrope', 'Inter', sans-serif;
  letter-spacing: -.01em;
}

.mono, code, .code-tag {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: .85em;
  letter-spacing: -.01em;
}

a { text-decoration: none; }
::selection { background: var(--signal-glow); }

/* Slim technical scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ===================== APP SHELL ===================== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- Sidebar : dark console panel with subtle texture ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--ink-950);
  background-image:
    linear-gradient(var(--ink-950), var(--ink-950)),
    repeating-linear-gradient(115deg, rgba(179, 18, 43,.05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(25deg, rgba(179, 18, 43,.04) 0 1px, transparent 1px 84px);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1030;
  transition: transform .25s ease;
  border-right: 1px solid var(--border-dark);
}

.sidebar-brand { display: flex; align-items: center; gap: .8rem; padding: 1.5rem 1.35rem 1.1rem; }
.brand-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--ink-900); border: 1px solid rgba(242, 161, 172, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: var(--signal-on-dark); flex-shrink: 0;
  position: relative; overflow: hidden;
}
.brand-icon img {
  width: 100%; height: 100%; object-fit: contain; padding: 5px;
}
.brand-title { white-space: nowrap; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1; letter-spacing: .01em; }
.brand-sub { font-size: .66rem; color: rgba(255,255,255,.4); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

/* Signal bar — signature motif, a thin ambient pulse under the brand */
.signal-bar { height: 2px; margin: 0 1.35rem 1rem; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.06); position: relative; }
.signal-bar::after {
  content: ''; position: absolute; top: 0; left: -40%; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--signal-on-dark), transparent);
  animation: signal-sweep 2.8s ease-in-out infinite;
}
@keyframes signal-sweep {
  0% { left: -40%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .signal-bar::after { animation: none; left: 0; width: 100%; opacity: .5; }
}

.sidebar-menu { flex: 1; padding: .25rem .85rem; overflow-y: auto; }
.menu-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,.3); font-weight: 600;
  margin: 1.15rem .65rem .45rem;
}
.menu-label:first-child { margin-top: .2rem; }
.menu-item {
  display: flex; align-items: center; gap: .8rem;
  color: rgba(255,255,255,.68);
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .865rem;
  font-weight: 500;
  margin-bottom: .1rem;
  border-left: 2px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.menu-item i { font-size: 1.05rem; width: 20px; text-align: center; color: rgba(255,255,255,.45); transition: color .15s ease; }
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item:hover i { color: var(--signal-on-dark); }
.menu-item.active {
  background: rgba(242, 161, 172, .12);
  color: #fff;
  border-left-color: var(--signal-on-dark);
}
.menu-item.active i { color: var(--signal-on-dark); }
.sidebar-footer { padding: .8rem .85rem 1.15rem; border-top: 1px solid var(--border-dark); }

/* ---- Main content ---- */
.main-content { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }

.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 1.6rem;
  display: flex; align-items: center; gap: .75rem;
  position: sticky; top: 0; z-index: 1000;
}
.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--ink-700);
  transition: border-color .15s ease, color .15s ease;
}
.btn-icon:hover { border-color: var(--signal); color: var(--signal-dark); }

.topbar-search {
  display: flex; align-items: center; gap: .55rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .5rem .9rem;
  width: 100%; max-width: 400px;
  transition: border-color .15s ease, background .15s ease;
}
.topbar-search:focus-within { border-color: var(--signal); background: #fff; }
.topbar-search i { color: var(--ink-500); font-size: .9rem; }
.topbar-search input { border: none; outline: none; flex: 1; font-size: .85rem; background: transparent; }

.role-badge {
  background: var(--ink-100); color: var(--ink-700);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: .68rem; padding: .42rem .7rem; border-radius: 5px;
  border: 1px solid var(--border);
}

.user-chip {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--border); background: var(--card);
  border-radius: var(--radius-sm); padding: .3rem .7rem .3rem .3rem;
  font-size: .82rem; color: var(--ink-900); font-weight: 600;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--ink-900); border: 1px solid var(--signal-on-dark);
  color: var(--signal-on-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; font-family: 'Manrope', sans-serif;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink-900); border: 1px solid var(--signal-on-dark); color: var(--signal-on-dark);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
  font-weight: 700; font-size: .85rem; font-family: 'Manrope', sans-serif;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.avatar-upload .avatar-preview {
  width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-900); border: 2px solid var(--signal-on-dark); color: var(--signal-on-dark);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-weight: 700; font-size: 2rem; font-family: 'Manrope', sans-serif;
}
.avatar-upload .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload .avatar-actions { display: flex; flex-direction: column; gap: .4rem; }
.avatar-upload .avatar-hint { font-size: .74rem; color: var(--ink-500); }

.notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(240,69,63,.25);
}
.notif-dropdown { width: 350px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; margin-top: .5rem; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.notif-header strong { font-family: 'Manrope', sans-serif; font-size: .88rem; }
.notif-list { max-height: 350px; overflow-y: auto; }
.notif-item { display: block; padding: .75rem 1.1rem; border-bottom: 1px solid var(--ink-100); }
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: rgba(179, 18, 43,.05); border-left: 2px solid var(--signal); }
.notif-item .notif-title { font-size: .82rem; font-weight: 600; color: var(--ink-900); }
.notif-item .notif-message { font-size: .78rem; color: var(--ink-500); margin-top: 1px; }
.notif-item .notif-time { font-size: .68rem; color: var(--ink-300); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

.page-content { padding: 1.75rem; max-width: 1440px; }

/* ===================== LIVE / STATUS INDICATORS ===================== */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); margin-right: 6px; position: relative; top: -1px;
}
.live-dot.pulsing::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--success); animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(.6); opacity: .8; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ===================== CARDS & COMPONENTS ===================== */
.stat-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 1.3rem 1.45rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 1rem;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: var(--stat-accent, var(--signal));
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
  background: var(--stat-accent-bg, rgba(179, 18, 43,.1));
  color: var(--stat-accent, var(--signal));
}
.stat-card .stat-value { font-family: 'Manrope', sans-serif; font-size: 1.65rem; font-weight: 700; color: var(--ink-900); line-height: 1; }
.stat-card .stat-label { color: var(--ink-500); font-size: .78rem; margin-top: 5px; }

.card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; font-size: .9rem; background: #fff !important; }
.card-header strong { font-family: 'Manrope', sans-serif; font-weight: 600; }

.table { font-size: .855rem; margin-bottom: 0; }
.table thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); border-bottom: 1px solid var(--border); font-weight: 700; padding: .85rem 1rem; background: var(--surface); }
.table tbody td { padding: .8rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--ink-100); }
.table tbody tr:hover { background: rgba(179, 18, 43,.04); }
.table tbody tr:last-child td { border-bottom: none; }

.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: .845rem; letter-spacing: .01em; }
.btn-primary { background: var(--ink-950); border: 1px solid var(--ink-950); color: #fff; }
.btn-primary:hover { background: var(--signal-dark); border-color: var(--signal-dark); color: #fff; }
.btn-primary:focus { box-shadow: var(--shadow-glow); }
.btn-outline-primary { color: var(--ink-900); border-color: var(--border); }
.btn-outline-primary:hover { background: var(--ink-950); border-color: var(--ink-950); color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--ink-700); }
.btn-outline-secondary:hover { background: var(--ink-100); border-color: var(--border); color: var(--ink-900); }

/* Bootstrap "warning" re-themed to the palette's orange accent (used for
   pending/attention states like the Check-In button and revision badges). */
.btn-warning { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background: #d67e00; border-color: #d67e00; color: #fff; }
.btn-outline-warning { border-color: var(--amber); color: #b96f00; }
.btn-outline-warning:hover { background: var(--amber); border-color: var(--amber); color: #fff; }
.bg-warning { background: var(--amber) !important; color: #fff !important; }
.text-warning { color: var(--amber) !important; }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); font-size: .855rem; }
.form-control:focus, .form-select:focus { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-glow); }
.form-label { font-size: .8rem; font-weight: 600; color: var(--ink-700); margin-bottom: .35rem; }

.progress { border-radius: 20px; height: 8px; background: var(--ink-100); }
.progress-bar { background: var(--signal); }
.progress-bar.bg-success { background: var(--success) !important; }

.badge { font-weight: 600; font-size: .68rem; padding: .38em .6em; border-radius: 5px; letter-spacing: .01em; }

.dropdown-menu { border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: .85rem; }
.dropdown-item { padding: .55rem 1rem; }
.dropdown-item:hover { background: var(--surface); }

/* Catatan/chat thread box (project detail, Admin/PM) — same boxed &
   scrollable treatment as the Client Portal's note thread, so a long
   conversation stays contained instead of stretching the page. */
.note-thread-box {
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  padding: .75rem .9rem; max-height: 420px; overflow-y: auto;
}
.note-thread-box .note-row:last-child { border-bottom: none !important; }

/* @mention highlight inside rendered note/chat text */
.mention-tag {
  color: var(--signal); background: rgba(179, 18, 43, .1);
  padding: .05em .35em; border-radius: 4px; font-weight: 600;
}

/* @mention autocomplete dropdown for the note composer */
.mention-input-wrap { position: relative; }
.mention-suggest {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
}
.mention-suggest.show { display: block; }
.mention-suggest-item {
  padding: .5rem .75rem; cursor: pointer; display: flex; flex-direction: column; gap: .05rem;
  border-bottom: 1px solid var(--border);
}
.mention-suggest-item:last-child { border-bottom: none; }
.mention-suggest-item:hover, .mention-suggest-item:active { background: var(--surface); }
.mention-suggest-name { font-size: .82rem; font-weight: 600; color: var(--ink-900); }
.mention-suggest-meta { font-size: .72rem; color: var(--ink-500); }

.modal-content { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.modal-header, .modal-footer { border-color: var(--border); }

.alert { border-radius: var(--radius-md); border: 1px solid transparent; font-size: .865rem; }
.alert-success { background: rgba(22,179,120,.08); color: #0a6b48; border-color: rgba(22,179,120,.2); }
.alert-danger { background: rgba(240,69,63,.08); color: #a8221d; border-color: rgba(240,69,63,.2); }

/* Project code / IDs shown in mono to feel systemized */
.code-chip {
  font-family: 'JetBrains Mono', monospace; font-size: .78rem;
  background: var(--ink-100); color: var(--ink-700);
  padding: .2rem .5rem; border-radius: 5px; letter-spacing: -.02em;
}

/* ===================== GALLERY ===================== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.gallery-grid img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); transition: transform .15s ease, box-shadow .15s ease; }
.gallery-grid a:hover img { transform: scale(1.03); box-shadow: var(--shadow-md); }
.gallery-group-title { font-family: 'Manrope', sans-serif; font-weight: 700; color: var(--ink-900); margin-top: 1.2rem; }

/* ===================== LIVE CAMERA CAPTURE (Check-In/Out) ===================== */
.camera-box {
  position: relative; width: 100%; height: 260px; border-radius: var(--radius-md);
  background: var(--ink-950); overflow: hidden; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.camera-box video, .camera-box img { width: 100%; height: 100%; object-fit: cover; }
.camera-box .camera-error {
  color: rgba(255,255,255,.7); text-align: center; padding: 1.5rem; font-size: .8rem;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.camera-box .camera-error i { font-size: 1.8rem; }

/* ===================== KANBAN ===================== */
.kanban-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-column { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 275px; max-width: 275px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.kanban-column-header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.kanban-column-body { padding: .75rem; flex: 1; min-height: 140px; display: flex; flex-direction: column; gap: .6rem; }
.kanban-column-body.drag-over { background: rgba(179, 18, 43,.06); }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--signal); border-radius: var(--radius-sm); padding: .7rem .8rem; cursor: grab; transition: box-shadow .15s ease, transform .15s ease; }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-title { font-size: .8rem; font-weight: 700; color: var(--ink-900); margin-bottom: .35rem; }
.kanban-card-meta { font-size: .7rem; color: var(--ink-500); display: flex; align-items: center; gap: .3rem; margin-top: 2px; }

/* ===================== AUTH (LOGIN) ===================== */
.auth-body { background: var(--ink-950); min-height: 100vh; }
.auth-split { min-height: 100vh; display: flex; }
.auth-visual {
  flex: 1.15; background: var(--ink-950);
  background-image:
    repeating-linear-gradient(115deg, rgba(179, 18, 43,.07) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(25deg, rgba(179, 18, 43,.05) 0 1px, transparent 1px 80px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 4.5rem; color: #fff; position: relative; overflow: hidden;
}
.auth-visual .pulse-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth-visual .pulse-dot {
  position: absolute; border-radius: 50%; background: #F2A1AC; opacity: 0;
  box-shadow: 0 0 14px 3px rgba(242, 161, 172, .55);
  animation: pulse-dot 3.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: .85; transform: scale(1); }
}
.auth-visual .waveform { display: flex; align-items: flex-end; gap: 5px; height: 60px; margin-bottom: 2rem; position: relative; z-index: 1; }
.auth-visual .waveform span {
  width: 5px; border-radius: 3px; animation: wave 1.4s ease-in-out infinite;
  background: linear-gradient(180deg, #F4B3BC, var(--signal));
  box-shadow: 0 0 10px rgba(242, 161, 172, .5);
}
@keyframes wave { 0%, 100% { height: 18%; opacity: .55; } 50% { height: 100%; opacity: 1; } }
.auth-visual h2 { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 2.1rem; max-width: 440px; position: relative; z-index: 1; line-height: 1.2; }
.auth-visual p { color: rgba(255,255,255,.6); max-width: 420px; position: relative; z-index: 1; margin-top: .9rem; }
.auth-visual .stat-strip { display: flex; gap: 2.5rem; margin-top: 3rem; position: relative; z-index: 1; }
.auth-visual .stat-strip .val { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.35rem; color: #F2A1AC; text-shadow: 0 0 18px rgba(242, 161, 172, .45); }
.auth-visual .stat-strip .lbl { font-size: .72rem; color: rgba(255,255,255,.6); margin-top: 3px; }

.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand-row { display: flex; align-items: center; gap: .7rem; margin-bottom: 2.2rem; }
.auth-logo-mark { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }

@media (max-width: 900px) {
  .auth-visual { display: none; }
}

/* ===================== PORTAL (CLIENT PUBLIC) ===================== */
.portal-header {
  background: var(--ink-950);
  background-image: repeating-linear-gradient(115deg, rgba(179, 18, 43,.08) 0 1px, transparent 1px 60px);
  color: #fff; padding: 2.75rem 1.5rem;
}
.timeline { border-left: 2px solid var(--border); padding-left: 1.25rem; margin-left: .5rem; }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.6rem; top: .2rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 0 3px rgba(179, 18, 43,.18);
}

/* ===================== MOBILE: TABEL & TEKS TIDAK KELUAR KOLOM ===================== */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Tabel dengan banyak kolom (mis. daftar Project): padding lebih rapat supaya muat di layar desktop */
.table.table-compact thead th { padding: .75rem .5rem; }
.table.table-compact tbody td { padding: .65rem .5rem; font-size: .86rem; }
.table-compact .code-chip { font-size: .78rem; padding: .15rem .4rem; }
table.dataTable.table-compact > thead > tr > th.sorting,
table.dataTable.table-compact > thead > tr > th.sorting_asc,
table.dataTable.table-compact > thead > tr > th.sorting_desc { padding-right: 1.15rem; }
/* Baris "Kode project" dll tidak dipotong per karakter di sel sempit */
.code-chip { white-space: nowrap; }
.page-content, .page-content .card, .page-content .card-body, .page-content .modal-body { min-width: 0; }

@media (max-width: 767.98px) {
  /* Teks panjang (nama, email, nomor PO, URL) turun ke baris baru, tidak melebar */
  .page-content { overflow-wrap: break-word; }
  .page-content h4, .page-content h5, .page-content .card-header { overflow-wrap: anywhere; }

  /* Tabel -> kartu bertumpuk. Label kolom diambil dari <thead> oleh app.js
     (atribut data-label), jadi tidak perlu mengubah markup tiap halaman. */
  table.table-stack, table.table-stack > tbody, table.table-stack > tbody > tr, table.table-stack > tbody > tr > td {
    display: block; width: 100% !important; max-width: 100%;
  }
  table.table-stack { padding: .75rem .75rem .15rem; }
  .dataTables_wrapper table.table-stack { padding: 0; }
  table.table-stack > thead { display: none; }
  table.table-stack > tbody > tr {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: #fff; margin: 0 0 .75rem; padding: .35rem 0;
  }
  table.table-stack > tbody > tr:last-child { margin-bottom: .75rem; }
  table.table-stack > tbody > tr > td {
    box-sizing: border-box !important; /* DataTables memaksa content-box pada td */
    background: transparent !important; box-shadow: none !important;
    border: 0 !important; padding: .4rem .85rem; text-align: left !important;
    white-space: normal !important; overflow-wrap: anywhere; word-break: normal;
  }
  table.table-stack > tbody > tr > td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; margin-bottom: .15rem;
    font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-500);
  }
  table.table-stack > tbody > tr > td[colspan] { text-align: center !important; }
  table.table-stack > tbody > tr > td img { max-width: 100%; height: auto; }
  table.table-stack > tbody > tr > td .form-select,
  table.table-stack > tbody > tr > td .form-control { max-width: 100%; }
  table.table-stack > tbody > tr > td .d-flex { flex-wrap: wrap; }

  /* Kontrol DataTables (Tampilkan / Cari / halaman) */
  .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { text-align: center !important; }
  .dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; gap: .5rem; width: 100%; }
  .dataTables_wrapper .dataTables_filter input { flex: 1; min-width: 0; width: 100% !important; margin-left: 0 !important; }
  .dataTables_wrapper .pagination { flex-wrap: wrap; justify-content: center; }

  /* Baris judul halaman / header kartu berisi tombol: boleh turun baris */
  .page-content .d-flex.justify-content-between,
  .page-content .card-header.d-flex { flex-wrap: wrap; gap: .5rem; }
  .page-content .btn-group { flex-wrap: wrap; }
}

@media (max-width: 575.98px) {
  /* Topbar HP kecil: kolom cari menyusut mengikuti sisa ruang, tidak mendorong halaman melebar */
  .topbar { padding: .6rem .75rem; gap: .5rem; }
  .topbar-search { flex: 1 1 0; min-width: 0; max-width: none; padding: .5rem .7rem; }
  .topbar-search input { min-width: 0; width: 100%; }
  .topbar > .ms-auto { margin-left: 0 !important; flex-shrink: 0; gap: .4rem !important; }
  .page-content { padding: .85rem; }
  .notif-dropdown { width: min(350px, calc(100vw - 1.5rem)); }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar-search { max-width: 180px; }
  .page-content { padding: 1.1rem; }
}

@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ===================== GOED BRAND THEME =====================
   Makes GOED Project feel like a continuation of goed.co.id: light and
   airy surfaces, brand red taken from the logo, pill buttons, small
   letter-spaced "eyebrow" labels above headings, rounded cards.
   Everything is driven by the variables below — to fine-tune the look, change
   them here (brand red, radius, page background) and the whole system follows.
   ======================================================================== */
:root {
  --brand: #B3122B;            /* GOED red */
  --brand-dark: #8F0E22;
  --brand-deep: #5E0A18;
  --brand-light: #E5484D;
  --brand-tint: #FDEBEC;       /* soft red wash for hover / active / badges */
  --brand-gray: #808080;       /* neutral gray */

  --signal: var(--brand);
  --signal-dark: var(--brand-dark);
  --signal-glow: rgba(179, 18, 43, .22);
  --signal-on-dark: #F4B3BC;

  --ink-950: #1C1112;
  --ink-900: #2A1A1C;
  --ink-800: #3A2528;
  --ink-700: #4A3A3D;
  --ink-500: #7a6f72;
  --ink-300: #E0D6D8;
  --ink-100: #F3EEEE;

  --surface: #FAF7F7;
  --border: #EADFE0;
  --amber: #F18F01;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(28, 17, 18, .04), 0 2px 6px rgba(28, 17, 18, .03);
  --shadow-md: 0 14px 34px rgba(28, 17, 18, .10);

  /* Bootstrap's own "primary" follows the brand, so badges, links, progress bars
     and every .bg-primary / .text-primary in the app turn brand red too. */
  --bs-primary: #B3122B;
  --bs-primary-rgb: 179, 18, 43;
  --bs-link-color: #B3122B;
  --bs-link-color-rgb: 179, 18, 43;
  --bs-link-hover-color: #8F0E22;
  --bs-link-hover-color-rgb: 143, 14, 34;
  --bs-body-color: #2A1A1C;
  --bs-border-color: #EADFE0;
}

body { background: var(--surface); }
h1, h2, h3, h4, h5, h6, .display-font { font-weight: 700; color: var(--ink-950); letter-spacing: -.015em; }
::selection { background: rgba(179, 18, 43, .18); }

/* Small uppercase label above a heading — the website's section "eyebrow" */
.eyebrow {
  display: inline-block; font-family: 'Inter', sans-serif; font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin-bottom: .55rem;
}
.text-accent { color: var(--brand); }

/* ---------- Sidebar: white, clean, brand-red pill for the active page ---------- */
.sidebar {
  background: #fff; background-image: none; color: var(--ink-900);
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 1.4rem 1.35rem 1.1rem; }
.brand-icon { background: transparent; border: 0; width: 44px; height: 44px; border-radius: 0; overflow: visible; }
.brand-icon img { padding: 0; }
.brand-title { color: var(--ink-950); font-size: 1.1rem; letter-spacing: -.01em; }
.brand-sub { color: var(--ink-500); font-family: 'Inter', sans-serif; font-size: .7rem; letter-spacing: .02em; margin-top: 5px; }
.signal-bar { display: none; }
.sidebar-menu { padding: .35rem .9rem; }
.menu-label {
  font-family: 'Inter', sans-serif; font-size: .64rem; font-weight: 600; letter-spacing: .16em;
  color: var(--ink-500); margin: 1.3rem .85rem .5rem;
}
.menu-item {
  color: var(--ink-700); border-left: 0; border-radius: var(--pill);
  padding: .62rem .95rem; font-weight: 500; margin-bottom: .15rem;
}
.menu-item i { color: var(--ink-500); }
.menu-item:hover { background: var(--brand-tint); color: var(--brand); }
.menu-item:hover i { color: var(--brand); }
.menu-item.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(179, 18, 43, .28); }
.menu-item.active i { color: #fff; }
.menu-item.text-danger { color: #C62F3B !important; }
.menu-item.text-danger i { color: #C62F3B; }
.menu-item.text-danger:hover { background: #FDEBEC; }
.sidebar-footer { border-top: 1px solid var(--border); }

/* ---------- Top bar ---------- */
.topbar { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border); padding: .75rem 1.6rem; }
.btn-icon { border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--ink-700); }
.btn-icon:hover { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--brand); }
.topbar-search { border-radius: var(--pill); background: var(--surface); padding: .52rem 1.05rem; max-width: 420px; }
.topbar-search:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--signal-glow); }
.role-badge {
  background: var(--brand-tint); color: var(--brand); border: 0; border-radius: var(--pill);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .72rem; padding: .45rem .9rem; letter-spacing: .01em;
}
.user-chip { border-radius: var(--pill); background: #fff; padding: .28rem .8rem .28rem .28rem; }
.user-avatar, .avatar-sm {
  background: var(--brand-tint); color: var(--brand); border: 0; border-radius: 50%;
}
.avatar-upload .avatar-preview { background: var(--brand-tint); color: var(--brand); border-color: #fff; box-shadow: 0 0 0 2px var(--brand-tint); }
.site-link {
  display: none; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--ink-700);
  padding: .45rem .9rem; border-radius: var(--pill); border: 1px solid var(--border); background: #fff;
  transition: all .15s ease; white-space: nowrap;
}
.site-link:hover { color: var(--brand); border-color: var(--brand-tint); background: var(--brand-tint); }
@media (min-width: 992px) { .site-link { display: inline-flex; } }

/* ---------- Cards, stat tiles, tables ---------- */
.card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: #fff; }
.card-header { background: #fff !important; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.card-header strong { font-weight: 700; color: var(--ink-950); }
.card-body { padding: 1.25rem; }
.stat-card { border-radius: var(--radius-lg); padding: 1.35rem 1.5rem; }
.stat-card::before { display: none; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 14px; }
.stat-card .stat-value { font-size: 1.75rem; color: var(--ink-950); }
.stat-card .stat-label { font-size: .78rem; color: var(--ink-500); font-weight: 500; }
.table thead th {
  background: #fff; color: var(--ink-500); font-weight: 600; font-size: .66rem; letter-spacing: .12em;
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: rgba(179, 18, 43, .035); }
.table tbody td { border-bottom: 1px solid var(--ink-100); }
.code-chip { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; border-radius: 6px; }
.mono, code, .code-tag { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

/* ---------- Buttons: pill-shaped like the website's CTAs ---------- */
.btn { border-radius: var(--pill); font-weight: 600; font-size: .85rem; padding: .5rem 1.15rem; letter-spacing: 0; }
.btn-sm { padding: .32rem .85rem; font-size: .78rem; }
.btn-lg { padding: .7rem 1.6rem; font-size: .95rem; }
.btn-icon, .btn.btn-icon { padding: 0; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; color: #fff; }
.btn-primary:focus { box-shadow: 0 0 0 4px var(--signal-glow); }
.btn-outline-primary { color: var(--brand); border-color: rgba(179, 18, 43, .35); background: #fff; }
.btn-outline-primary:hover, .btn-outline-primary:active { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.btn-outline-secondary { border-color: var(--border); color: var(--ink-700); background: #fff; }
.btn-outline-secondary:hover { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--brand); }
.btn-link { color: var(--brand); font-weight: 600; }
.btn-group > .btn, .input-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child, .input-group > .btn:first-child { border-radius: var(--pill) 0 0 var(--pill); }
.btn-group > .btn:last-child, .input-group > .btn:last-child { border-radius: 0 var(--pill) var(--pill) 0; }
.btn-group > .btn:only-child { border-radius: var(--pill); }

/* ---------- Forms, badges, misc ---------- */
.form-control, .form-select { border-radius: 12px; border-color: var(--border); padding: .58rem .95rem; background-color: #fff; font-size: .88rem; }
.form-control-sm, .form-select-sm { padding: .35rem .75rem; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--signal-glow); }
.form-label { color: var(--ink-700); font-weight: 600; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.badge { border-radius: var(--pill); padding: .42em .75em; font-weight: 600; letter-spacing: .01em; }
.badge.bg-light { background: var(--ink-100) !important; }
.progress { height: 8px; background: var(--ink-100); }
.progress-bar { background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
.progress-bar.bg-success { background: var(--success) !important; }
.alert { border-radius: var(--radius-md); }
.dropdown-menu { border-radius: var(--radius-md); padding: .4rem; }
.dropdown-item { border-radius: 10px; }
.dropdown-item:hover { background: var(--brand-tint); color: var(--brand); }
.dropdown-item.text-danger:hover { background: #FDEBEC; color: #C62F3B; }
.modal-content { border-radius: var(--radius-lg); border: 0; box-shadow: 0 30px 70px rgba(28, 17, 18, .25); }
.notif-dropdown { border-radius: var(--radius-lg); padding: 0; }
.notif-header { background: #fff; }
.notif-item.unread { background: var(--brand-tint); border-left: 3px solid var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); }
.kanban-card { border-left-color: var(--brand); }
.timeline-item::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(179, 18, 43, .18); }
.live-dot.pulsing { margin-right: 4px; }
.stat-value .live-dot { display: none; }

/* ===================== AUTH (login / register) — website-style split ===================== */
.auth-body { background: #fff; }
.auth-visual {
  flex: 1.1; color: #fff; position: relative; overflow: hidden;
  padding: 2.25rem clamp(2rem, 5vw, 4.5rem) 0; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 255, 255, .16), transparent 60%),
    radial-gradient(700px 420px at 100% 100%, rgba(229, 72, 77, .45), transparent 65%),
    linear-gradient(150deg, #D3263D 0%, #B3122B 45%, #5E0A18 100%);
}
.auth-visual::before, .auth-visual::after {
  content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none;
}
.auth-visual::before { width: 620px; height: 620px; right: -220px; top: -160px; }
.auth-visual::after  { width: 880px; height: 880px; right: -360px; top: -290px; border-color: rgba(255, 255, 255, .07); }
.auth-visual .pulse-field, .auth-visual .waveform { display: none; }
.auth-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.auth-top .auth-brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.auth-top .auth-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 12px; padding: 5px; }
.auth-top .auth-brand strong { font-family: 'Manrope', sans-serif; font-size: 1.05rem; line-height: 1.1; display: block; }
.auth-top .auth-brand span { font-size: .7rem; color: rgba(255, 255, 255, .7); }
.auth-pill {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: #fff;
  padding: .5rem 1.05rem; border-radius: var(--pill); border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08);
  text-decoration: none; transition: all .15s ease;
}
.auth-pill:hover { background: #fff; color: var(--brand); border-color: #fff; }
.auth-visual-body { position: relative; z-index: 2; max-width: 540px; padding: 3rem 0; }
.auth-visual .eyebrow { color: #F6C9CE; margin-bottom: 1rem; }
.auth-visual h2 { font-size: clamp(2rem, 3.4vw, 3.05rem); line-height: 1.12; max-width: 520px; color: #fff; font-weight: 700; }
.auth-visual h2 .accent { color: #F6C9CE; }
.auth-visual p { color: rgba(255, 255, 255, .78); max-width: 470px; font-size: 1rem; line-height: 1.65; margin-top: 1.1rem; }
.auth-visual .stat-strip { display: flex; gap: 2.75rem; margin-top: 2.6rem; }
.auth-visual .stat-strip .val { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 2rem; color: #fff; text-shadow: none; line-height: 1; }
.auth-visual .stat-strip .lbl { font-size: .78rem; color: rgba(255, 255, 255, .72); margin-top: 6px; }
.auth-marquee { position: relative; z-index: 2; margin: 0 calc(-1 * clamp(2rem, 5vw, 4.5rem)); border-top: 1px solid rgba(255, 255, 255, .16); overflow: hidden; background: rgba(94, 10, 24, .35); }
.auth-marquee-track { display: flex; width: max-content; animation: auth-marquee 38s linear infinite; padding: 1rem 0; }
.auth-marquee-track span { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); white-space: nowrap; padding: 0 1.1rem; }
.auth-marquee-track span.star { color: #F6C9CE; padding: 0; }
@keyframes auth-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .auth-marquee-track { animation: none; } }

.auth-form-side { flex: 1; background: #fff; padding: 2rem clamp(1.5rem, 4vw, 4rem); flex-direction: column; }
.auth-card { max-width: 420px; }
.auth-card .brand-row { display: none; }
.auth-card h1, .auth-card h4.auth-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 2rem; letter-spacing: -.02em; margin-bottom: .45rem; }
.auth-card .auth-sub { color: var(--ink-500); margin-bottom: 1.8rem; }
.auth-card .form-control { padding: .75rem 1rem; }
.auth-card .btn-primary { padding: .8rem 1.4rem; font-size: .95rem; }
.auth-card .btn-primary .bi { transition: transform .15s ease; }
.auth-card .btn-primary:hover .bi { transform: translateX(3px); }
.auth-alt { text-align: center; color: var(--ink-500); font-size: .88rem; margin-top: 1.5rem; }
.auth-alt a { font-weight: 600; }
.auth-mobile-brand { display: none; }
@media (max-width: 900px) {
  .auth-form-side { min-height: 100vh; }
  .auth-mobile-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; }
  .auth-mobile-brand img { width: 44px; height: 44px; object-fit: contain; }
}

/* ===================== CLIENT PORTAL header ===================== */
.portal-header {
  background: linear-gradient(150deg, #D3263D 0%, #B3122B 50%, #5E0A18 100%); background-image: none;
}

/* Headings that sit on the red hero / panels must stay white (the global heading colour is charcoal) */
.cp-hero h1, .cp-hero h2, .cp-hero h3, .cp-hero .cp-hero-title h1, .portal-header h1, .portal-header h2,
.auth-visual h2, .progress-ring .pct-label .num, .cp-nav .cp-brand-text { color: #fff; }

/* ===================== Error pages (403 / 404 / invalid portal link) ===================== */
.err-page { min-height: calc(100vh - 170px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-body .err-page { min-height: 100vh; background:
  radial-gradient(700px 380px at 50% -10%, rgba(179, 18, 43, .10), transparent 65%), #fff; }
.err-card { max-width: 540px; text-align: center; }
.err-code {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(5rem, 15vw, 8.5rem); line-height: 1; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .6rem;
}
.err-logo { display: block; width: 72px; height: 72px; object-fit: contain; margin: 0 auto 1.2rem; }
.err-card .eyebrow { display: block; }
.err-title { font-family: 'Manrope', sans-serif; font-weight: 700; margin-bottom: .6rem; }
.err-text { color: var(--ink-500); margin: 0 auto 1.6rem; max-width: 440px; }


/* ---- show / hide password ---- */
.pw-wrap { position:relative; }
.pw-wrap > .form-control { padding-right:2.9rem; }
.pw-toggle { position:absolute; top:0; right:0; height:100%; min-height:38px; width:2.9rem; border:0; background:transparent; color:#7a6f72; display:flex; align-items:center; justify-content:center; border-radius:0 var(--bs-border-radius, .5rem) var(--bs-border-radius, .5rem) 0; cursor:pointer; }
.pw-toggle:hover, .pw-toggle:focus-visible { color:#B3122B; outline:none; }
.pw-toggle i { font-size:1.05rem; pointer-events:none; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display:none; }
