/* Flexbox centering for Research File cell in My IPO table */
#myWorkTable td.research-file-cell {
    padding: 0 !important;
    vertical-align: middle;
}
#myWorkTable .file-upload-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 8px;
}
:root {
  --primary: #4f46e5;
  --primary-light: #675ff3;
  --secondary: #10b981;
  --secondary-light: #34d399;
  --bg-light: #f0f4f8;
  --bg-dark: #1f2937;
  --text-light: #ffffff;
  --text-dark: #1f2937;
  --border-color: #e2e8f0;
  --card-bg: #ffffffcc;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
  --font-family: 'Inter', sans-serif;
  --gradient-start: #e0eafc;
  --gradient-end: #cfdef3;
  --glass-blur: blur(12px);
}

html, body {
    scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(120deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

.container, .container-fluid {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.navbar {
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
  backdrop-filter: var(--glass-blur);
}

.navbar-brand {
    color: var(--primary) !important;
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.navbar-brand:hover {
    color: var(--secondary-light) !important;
}

.navbar-nav .nav-link {
    color: var(--text-dark) !important;
    transition: color 0.2s, background 0.2s;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--secondary-light) !important;
    background: rgba(16,185,129,0.10);
}

.navbar-nav .nav-link svg {
    vertical-align: middle;
    margin-right: 0.25rem;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.navbar-nav .nav-link:hover svg,
.navbar-nav .nav-link.active svg {
    opacity: 1;
}

.dropdown-menu {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px 0 rgba(60,60,60,0.10);
    font-size: 1rem;
    border: none;
}

.dropdown-item {
    color: var(--text-dark);
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--text-light);
}

.dropdown-item.active {
    background: var(--secondary);
    color: var(--text-light);
}

/* Main Content Card */
.content-card {
    background: var(--card-bg);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    backdrop-filter: var(--glass-blur);
}

h2, h3, h4, h5 {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #374151;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    background-color: #fdfdfe;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.2);
    background-color: var(--card-bg);
}

/* Buttons */
.btn-primary, .btn-success, .btn-secondary {
    border-radius: 0.7rem;
    font-weight: 700;
    padding: 0.8rem 1.7rem;
    box-shadow: 0 4px 12px -2px rgba(79,70,229,0.10);
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary) 60%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--primary-light) 60%, var(--primary) 100%);
    border-color: var(--primary-light);
}

.btn-success {
    background: linear-gradient(90deg, var(--secondary) 60%, var(--secondary-light) 100%);
    border-color: var(--secondary);
    color: var(--text-light);
}

.btn-success:hover {
    background: linear-gradient(90deg, var(--secondary-light) 60%, var(--secondary) 100%);
    border-color: var(--secondary-light);
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 500;
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

.btn-outline-secondary:hover {
    background: var(--primary-light);
    color: var(--text-light);
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#tableLatest {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1800px;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.table-hover > tbody > tr {
    transition: background 0.15s;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f3f6f9;
}

.table thead th {
    background-color: #eef2f6;
    border-bottom: 2px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    font-weight: 700;
    color: #374151;
    padding: 1rem 1.25rem;
    text-align: left;
}

.table td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
}

/* Vertically center the upload button in Research File column of My IPO table */
#myWorkTable td:nth-child(5) {
    vertical-align: middle !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.table td a:hover {
    text-decoration: underline;
}

.date-column { width: 9%; }
/* .company-column { width: 15%; } removed duplicate */
.type-column { width: 6%; }
.source-column { width: 6%; }
.atc-column { width: 7%; }
.financials-column { width: 8%; }
.research-column { width: 11%; }
.analyst-column { width: 18%; }
 .decision-column { width: 24%; }
 .company-column { width: 12%; }
.admin-decision-column { width: 10%; }
.admin-comment-column { width: 20%; }


/* Loader */
#loaderOverlay {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: var(--glass-blur);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-border {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--primary);
  border-width: 0.35em;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loaderText {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}

/* Alerts */
#statusAlert {
  right: 1.5rem;
  bottom: 1.5rem;
  min-width: 300px;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  animation: fadeInDown 0.7s cubic-bezier(.4,0,.2,1);
}

#statusAlert.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

#statusAlert.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

#statusAlert.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

/* Sortable table headers */
th.sortable::after {
  content: '\25B2';
  font-size: 0.8em;
  margin-left: 0.3em;
  color: #cbd5e1;
  opacity: .6;
}

th.sortable.asc::after {
  content: '\25B2';
  color: var(--secondary);
  opacity: 1;
}

th.sortable.desc::after {
  content: '\25BC';
  color: var(--secondary);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.3rem;
    }
    .navbar-nav .nav-link {
        padding: 0.4rem 0.8rem;
    }
    .content-card {
        padding: 1.5rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    .btn-primary {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .table thead th,
    .table td {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    #statusAlert {
        min-width: unset;
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}