/* ============================================================
   JIOCHAEL Press - Academic UI
   Theme driven by CSS custom properties (tenant overrides)
   ============================================================ */

:root {
  --brand-primary: #1a365d;
  --brand-secondary: #2b6cb0;
  --brand-accent: #ed8936;
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #1a202c;
  --text-muted: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Merriweather", "Georgia", serif;
  --max-width: 1120px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--brand-secondary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--brand-primary);
  color: #fff;
  padding: 0.85rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.logo:hover {
  text-decoration: none;
  opacity: 0.95;
}
.logo img {
  height: 36px;
  width: auto;
  border-radius: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--brand-secondary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-primary);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-accent {
  background: var(--brand-accent);
  color: #fff;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: #fff;
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.hero p {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  opacity: 0.92;
  font-size: 1.05rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-body {
  padding: 1.25rem 1.35rem;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--brand-primary);
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.925rem;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-open {
  background: #c6f6d5;
  color: #276749;
}
.badge-status {
  background: #ebf8ff;
  color: #2b6cb0;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}
textarea.form-control {
  min-height: 110px;
  resize: vertical;
}
select.form-control {
  appearance: auto;
}

/* Dashboard layout */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}
.dash-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
}
.dash-sidebar nav a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.925rem;
  border-left: 3px solid transparent;
}
.dash-sidebar nav a:hover,
.dash-sidebar nav a.active {
  background: #edf2f7;
  color: var(--brand-primary);
  border-left-color: var(--brand-secondary);
  text-decoration: none;
}
.dash-main {
  padding: 1.75rem 1.5rem;
}
.dash-main h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  color: var(--brand-primary);
}
.dash-main .subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: #f7fafc;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data tr:hover td {
  background: #fafbfc;
}

/* Alerts */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.925rem;
}
.alert-error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}
.alert-success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}
.alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #90cdf4;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tabs button {
  background: none;
  border: none;
  padding: 0.65rem 1.1rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}
.tabs button.active {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Modal (simple) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: calc(var(--radius) + 2px);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}
.modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.modal-body {
  padding: 1.25rem 1.35rem;
}
.modal-footer {
  padding: 0.85rem 1.35rem 1.15rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Auth box */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #edf2f7 0%, #e2e8f0 100%);
}
.auth-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}
.auth-box h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  color: var(--brand-primary);
  text-align: center;
}
.auth-box .sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Utility */
.hidden {
  display: none !important;
}
.text-muted {
  color: var(--text-muted);
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }
  .dash-sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding: 0 0.5rem;
  }
  .dash-sidebar nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 0.55rem 0.85rem;
  }
  .dash-sidebar nav a.active {
    border-left: none;
    border-bottom-color: var(--brand-secondary);
  }
}