/* GMS Workflow – app.css */

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

:root {
  --primary: #1a3c6e;
  --primary-light: #2a5298;
  --accent: #e8a020;
  --bg: #f0f4f8;
  --white: #ffffff;
  --surface: #ffffff;
  --border: #d1dbe8;
  --text: #1e2d3d;
  --muted: #6b7a90;
  --danger: #dc3545;
  --success: #198754;
  --warning: #e8a020;
  --info: #0d6efd;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── NAVBAR ── */
.navbar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 60px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 24px; }
.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; opacity: .7; }
.nav-links { display: flex; list-style: none; gap: 4px; flex: 1; padding-left: 20px; }
.nav-links a {
  color: rgba(255,255,255,0.8); text-decoration: none;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; transition: background .15s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,0.85); }
.btn-logout { background: rgba(255,255,255,0.15); color: #fff; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; text-decoration: none; }
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ── LAYOUT ── */
.main-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--primary); }
.page-header .sub { font-size: 13px; color: var(--muted); }

/* ── CARDS ── */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.yellow { background: #fef9c3; }
.stat-icon.red { background: #fee2e2; }
.stat-icon.purple { background: #f3e8ff; }
.stat-icon.orange { background: #ffedd5; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.1; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: all .15s; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #146c43; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline { background: transparent; color: var(--primary-light); border-color: var(--primary-light); }
.btn-outline:hover { background: var(--primary-light); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); border-color: #e2e8f0; }
.btn-secondary:hover { background: #cbd5e1; }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 14px; font-family: inherit;
  background: var(--white); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(42,82,152,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-section { margin-bottom: 28px; }
.form-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--primary); letter-spacing: .6px; padding: 8px 0; border-bottom: 2px solid var(--primary); margin-bottom: 16px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--primary); color: #fff; }
thead th { padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .3px; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: #f7fafd; }
tbody td { padding: 9px 12px; vertical-align: middle; }
td.nowrap { white-space: nowrap; }
td.mono { font-family: monospace; font-size: 12px; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-progress { background: #fef9c3; color: #854d0e; }
.badge-report { background: #e0e7ff; color: #4338ca; }
.badge-irs { background: #ffedd5; color: #c2410c; }
.badge-irs2 { background: #fee2e2; color: #991b1b; }
.badge-client { background: #d1fae5; color: #065f46; }
.badge-invoiced { background: #f3e8ff; color: #6b21a8; }
.badge-paid { background: #dcfce7; color: #14532d; }
.badge-cancelled { background: #f1f5f9; color: #475569; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error, .alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── TIMELINE ── */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline li { position: relative; padding-bottom: 16px; }
.timeline li::before { content: ''; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-light); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light); }
.timeline .tl-action { font-weight: 600; font-size: 13px; }
.timeline .tl-meta { font-size: 12px; color: var(--muted); }
.timeline .tl-detail { font-size: 12px; color: var(--text); margin-top: 2px; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 8px 18px; cursor: pointer; border: none; background: none; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color .15s; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── FILTERS ── */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filters-bar .form-group { margin: 0; }
.filters-bar label { font-size: 11px; }

/* ── WORKFLOW STEPS ── */
.workflow-steps { display: flex; gap: 0; margin-bottom: 24px; overflow-x: auto; }
.wf-step { flex: 1; min-width: 100px; text-align: center; padding: 10px 6px; position: relative; }
.wf-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -8px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 18px; z-index: 1;
}
.wf-dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 4px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.wf-dot.done { background: var(--success); color: #fff; }
.wf-dot.current { background: var(--primary-light); color: #fff; animation: pulse 2s infinite; }
.wf-dot.pending { background: #e2e8f0; color: var(--muted); }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(42,82,152,.4)} 50%{box-shadow:0 0 0 6px rgba(42,82,152,0)} }
.wf-label { font-size: 10px; color: var(--muted); line-height: 1.2; }
.wf-step.done .wf-label { color: var(--success); }
.wf-step.current .wf-label { color: var(--primary); font-weight: 700; }

/* ── FILE UPLOAD ── */
.file-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--primary-light); background: #f0f5ff; }
.file-drop input[type=file] { display: none; }
.file-drop .drop-icon { font-size: 28px; margin-bottom: 8px; }
.file-drop .drop-text { font-size: 13px; color: var(--muted); }

/* ── MISC ── */
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .items-center { align-items: center; }
.font-bold { font-weight: 700; } .text-primary { color: var(--primary); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.footer { text-align: center; padding: 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 40px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .workflow-steps { flex-wrap: nowrap; }
}

/* ── Print Invoice ── */
@media print {
  .navbar, .btn, .filters-bar, .tabs, footer { display: none !important; }
  .main-wrap { padding: 0; max-width: 100%; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  body { background: white; }
}

/* ── Role pills ── */
.role-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.role-admin    { background: #fef3c7; color: #92400e; }
.role-employee { background: #dbeafe; color: #1e40af; }
