:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e2e4e9;
  --primary: #2952e3;
  --primary-dark: #1f3fb8;
  --danger: #d64545;
  --success: #2a9d5c;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

header.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

header.topbar .logo {
  height: 32px;
  display: block;
}

header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

header.topbar nav a {
  margin-left: 16px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

header.topbar nav a:hover { color: var(--primary); }

header.topbar.home-header {
  position: relative;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
}

header.topbar.home-header .header-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

header.topbar.home-header .logo {
  height: 80px;
  display: block;
}

header.topbar.home-header .bull-logo {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  height: 110px;
  display: block;
}

header.topbar.home-header nav a {
  margin: 0 10px;
}

@media (max-width: 480px) {
  header.topbar.home-header .header-row {
    flex-direction: column;
  }
  header.topbar.home-header .bull-logo {
    position: static;
    transform: none;
    margin-top: 8px;
  }
}

.it-login-link { color: var(--danger) !important; }

main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

h2, h3 { margin-top: 0; font-weight: 700; color: var(--text); }

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 6px;
}

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}

textarea { min-height: 120px; resize: vertical; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--primary-dark); }

button.secondary, .btn.secondary { background: var(--muted); }
button.danger, .btn.danger { background: var(--danger); }
button.success, .btn.success { background: var(--success); }
button.success:hover, .btn.success:hover { background: #237a49; }

.login-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.login-row .card {
  flex: 1;
  min-width: 280px;
}

.login-row .btn {
  display: block;
  text-align: center;
}

.dept-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.dept-tab {
  background: none;
  border: none;
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.dept-tab:hover { background: #fafbfc; color: var(--text); }

.dept-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.msg { margin-top: 14px; font-size: 14px; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

.attachments { margin: 14px 0; font-size: 14px; }
.attachments ul { margin: 6px 0 0; padding-left: 20px; }
.attachments a { color: var(--primary); }

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filters select { width: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th { background: #fafbfc; color: var(--muted); font-size: 12px; text-transform: uppercase; }

tr:hover { background: #fafbfc; cursor: pointer; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.shared { background: #f3f4f6; color: #4b5563; font-weight: 700; }

.badge.status-new { background: #fee2e2; color: #991b1b; }
.badge.status-progress { background: #f3f4f6; color: #4b5563; }
.badge.status-done { background: #d1fae5; color: #065f46; }
.badge.status-cancelled { background: #f3f4f6; color: #6b7280; }

.priority-high { color: var(--danger); font-weight: 600; }
.priority-medium { color: var(--muted); font-weight: 600; }
.priority-low { color: var(--muted); }

.comment {
  border-top: 1px solid var(--border);
  padding: 10px 0;
  font-size: 14px;
}

.comment .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.wide-main { max-width: 1000px; }

.meta-row { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
