/* Business Reporter - File Exchange Portal - Main Stylesheet */

/* CSS Variables for Dark Theme (default) */
:root {
    --bg: #0f1117;
    --card: #1a1d29;
    --border: #2a2f3b;
    --ink: #e6e9f2;
    --muted: #9aa1ad;
    --primary: #d10a10;
    --primary-hover: #b00808;
    --dashboard-color: #FF6200;
    --primary-logo: url('/static/BR_logo_dark.png');
}

/* Light Theme */
[data-theme="light"] {
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e1e4e8;
    --ink: #1a1d29;
    --muted: #64748b;
    --primary: #d10a10;
    --primary-hover: #b00808;
    --dashboard-color: #FF6200;
    --primary-logo: url('/static/BR_logo_light.png');
}

* { 
  box-sizing: border-box;
}

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

.container { 
  max-width: 1800px; 
  margin: 40px auto; 
  padding: 0 16px; 
}

/* Card component */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  overflow-x: auto;
  overflow-y: visible;
}

/* Table styles */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, 
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #222533;
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
  overflow: visible;
}

.table thead th {
  font-weight: 600;
  color: var(--muted);
}

/* Form controls */
select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #2a2f3b;
  background: #0f1117;
  color: #e6e9f2;
  appearance: menulist;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
}

select option {
  background: #0f1117;
  color: #e6e9f2;
}

input[type=text], 
input[type=password],
input[type=email] { 
  width: 100%; 
  padding: 10px 12px; 
  border-radius: 10px; 
  border: 1px solid #2a2f3b; 
  background: #0f1117; 
  color: #e6e9f2;
}

input[type=file] { 
  color: #cbd5e1;
}

label { 
  display: block; 
  font-size: 14px; 
  margin: 8px 0 6px;
}

/* Header */
.header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 16px;
}

.h1 { 
  font-size: 22px; 
  font-weight: 700; 
  letter-spacing: .2px;
}

.muted { 
  color: var(--muted); 
  font-size: 13px;
}

/* Buttons */
.btn { 
  display: inline-block; 
  padding: 10px 14px; 
  border-radius: 10px; 
  border: 1px solid #1e90b8; 
  background: linear-gradient(180deg, #0c1f29, #0a1a22); 
  color: #e6f7ff; 
  text-decoration: none; 
  font-weight: 600; 
  cursor: pointer;
}

.btn:hover { 
  filter: brightness(1.1);
}

.btn.del { 
  border-color: #7b1e1e; 
  background: linear-gradient(180deg, #2b0f0f, #210b0b);
}

.btn.secondary { 
  border-color: #2a2f3b; 
  background: #191b24; 
  color: #e3e6ef;
}

/* Flash messages */
.flash { 
  padding: 10px 12px; 
  border-radius: 10px; 
  margin: 10px 0;
}

.flash.ok { 
  background: #0f3b27; 
  border: 1px solid #1a6b48;
}

.flash.error { 
  background: #3b0f0f; 
  border: 1px solid #6b1a1a;
}

/* Row actions */
.row_actions { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
  align-items: center;
}

.row_actions form { 
  margin: 0;
}

/* Top bar */
.topbar { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  justify-content: space-between; 
  margin: 12px 0 2px;
}

/* Footer */
.footer { 
  margin-top: 12px; 
  text-align: right;
}

.small { 
  font-size: 12px; 
  color: #9aa1ad;
}

/* Login box */
.loginbox { 
  max-width: 420px; 
  margin: 60px auto 30px;
}

.formrow { 
  margin-bottom: 12px;
}

/* Badge */
.badge { 
  padding: 3px 8px; 
  border-radius: 999px; 
  border: 1px solid #2a2f3b; 
  font-size: 11px; 
  color: #cbd5e1;
}

/* Urgency indicators */
.urg { 
  font-weight: 700;
}

.urg-high { 
  color: #ff4d4f;
}

.urg-normal { 
  color: #4caf50;
}

/* Inline forms */
.inline-form { 
  display: inline-flex; 
  gap: 6px; 
  align-items: center;
}

.inline-form button { 
  padding: 6px 10px; 
  border-radius: 8px; 
  border: 1px solid #2a2f3b; 
  background: #191b24; 
  color: #e3e6ef; 
  cursor: pointer;
}

.inline-form button:hover { 
  filter: brightness(1.1);
}

.inline-form .note-input { 
  flex: 0 0 260px !important; 
  min-width: 200px; 
  width: 260px !important;
}

/* Logos */
.logo-wrap { 
  display: flex; 
  justify-content: center; 
  margin: 14px 0;
}

.logo-wrap img { 
  max-height: 56px; 
  width: auto; 
  opacity: .95;
}

.logo-top img { 
  max-height: 112px;
}

.logo-bottom img { 
  max-height: 60px;
}

/* Utility classes */
.nowrap { 
  white-space: nowrap;
}

.thick-divider { 
  border-top: 4px solid #FF6200; 
  margin: 14px 0;
}

.section-label { 
  text-align: center; 
  margin: 8px 0 6px; 
  font-weight: 600; 
  color: #cbd5e1;
}

.center-link { 
  text-align: center; 
  margin: 22px 0 4px;
}

.center-link h2 a {
  color: var(--accent);
  text-decoration: none;
}

.center-link h2 a:hover {
  text-decoration: underline;
}
/* Three-dot menu button */
.menu-btn {
    background: transparent;
    border: none;
    color: var(--ink);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
}

.menu-btn:hover {
    background: #2a2f3b;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--ink);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
}

.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2a2f3b;
    background: #0f1117;
    color: #e6e9f2;
    font-family: inherit;
}

.modal-field textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}
/* Theme Toggle Switch */
.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px 0;
}

.theme-toggle-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    user-select: none;
}

.theme-toggle-label.active {
    color: var(--ink);
    font-weight: 600;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2f3b;
    transition: 0.3s;
    border-radius: 30px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .theme-slider {
    background-color: var(--primary);
}

input:checked + .theme-slider:before {
    transform: translateX(30px);
}

/* Brand logo dynamic switching */
.brand-logo {
    content: var(--primary-logo);
}

/* Dashboard link color */
.center-link a {
    color: var(--dashboard-color) !important;
}

.center-link a:hover {
    color: var(--primary) !important;
}
/* Thick divider row in table */
.thick-divider-row {
    text-align: center !important;
    font-weight: 600;
    font-size: 24px;
    color: var(--ink);
    background: var(--border);
    padding: 15px !important;
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
}
/* Publication status badges */
.pub-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.pub-status.ready {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.pub-status.needs-review {
    background: rgba(255, 77, 79, 0.2);
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
}

.pub-status.ready::before {
    content: "✓";
    font-weight: bold;
}

.pub-status.needs-review::before {
    content: "✗";
    font-weight: bold;
}