/* =========================================================================
   Publisher Module - Client Portal Styles
   Professional advertiser-facing portal theme
   Color scheme: #2c3e50 (primary dark), #3498db (accent blue),
                 #ecf0f1 (light bg), #ffffff (cards)
   ========================================================================= */

/* ----- CSS Variables ----- */
:root {
    --portal-primary: #2c3e50;
    --portal-primary-light: #34495e;
    --portal-accent: #3498db;
    --portal-accent-hover: #2980b9;
    --portal-success: #27ae60;
    --portal-warning: #f39c12;
    --portal-danger: #e74c3c;
    --portal-info: #3498db;
    --portal-bg: #ecf0f1;
    --portal-card-bg: #ffffff;
    --portal-text: #2c3e50;
    --portal-text-muted: #7f8c8d;
    --portal-border: #dce1e3;
    --portal-radius: 6px;
    --portal-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --portal-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --portal-transition: all 0.25s ease;
}

/* ----- Base / Layout ----- */
.publisher-portal {
    background: var(--portal-bg);
    min-height: 100vh;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    color: var(--portal-text);
    line-height: 1.6;
}

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

.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.portal-page-header {
    background: var(--portal-primary);
    color: #fff;
    padding: 24px 0;
    margin-bottom: 30px;
}

.portal-page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.portal-page-header .breadcrumb {
    background: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 13px;
}

.portal-page-header .breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.portal-page-header .breadcrumb a:hover {
    color: #fff;
}

.portal-page-header .breadcrumb .active {
    color: rgba(255, 255, 255, 0.9);
}

/* ----- Portal Sidebar Navigation ----- */
.portal-sidebar {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

.portal-sidebar .sidebar-header {
    background: var(--portal-primary);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.portal-sidebar .sidebar-header .company-logo {
    max-width: 120px;
    margin-bottom: 10px;
}

.portal-sidebar .sidebar-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.portal-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-sidebar-nav li {
    border-bottom: 1px solid var(--portal-border);
}

.portal-sidebar-nav li:last-child {
    border-bottom: none;
}

.portal-sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--portal-text);
    text-decoration: none;
    font-size: 14px;
    transition: var(--portal-transition);
}

.portal-sidebar-nav li a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    color: var(--portal-text-muted);
    transition: var(--portal-transition);
}

.portal-sidebar-nav li a:hover {
    background: var(--portal-bg);
    color: var(--portal-accent);
}

.portal-sidebar-nav li a:hover i {
    color: var(--portal-accent);
}

.portal-sidebar-nav li.active a {
    background: var(--portal-accent);
    color: #fff;
    font-weight: 600;
}

.portal-sidebar-nav li.active a i {
    color: #fff;
}

.portal-sidebar-nav li a .badge {
    margin-left: auto;
    background: var(--portal-accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.portal-sidebar-nav li.active a .badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ----- Cards ----- */
.portal-card {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--portal-transition);
}

.portal-card:hover {
    box-shadow: var(--portal-shadow-hover);
}

.portal-card-header {
    background: var(--portal-card-bg);
    border-bottom: 2px solid var(--portal-bg);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--portal-primary);
}

.portal-card-body {
    padding: 24px;
}

.portal-card-footer {
    background: #fafbfc;
    border-top: 1px solid var(--portal-border);
    padding: 14px 24px;
    text-align: right;
}

/* ----- Stat Cards (Dashboard) ----- */
.portal-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.portal-stat-card {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    transition: var(--portal-transition);
    border-left: 4px solid var(--portal-accent);
}

.portal-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--portal-shadow-hover);
}

.portal-stat-card.stat-success {
    border-left-color: var(--portal-success);
}

.portal-stat-card.stat-warning {
    border-left-color: var(--portal-warning);
}

.portal-stat-card.stat-danger {
    border-left-color: var(--portal-danger);
}

.portal-stat-card.stat-info {
    border-left-color: var(--portal-info);
}

.portal-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info .portal-stat-icon {
    background: rgba(52, 152, 219, 0.1);
    color: var(--portal-accent);
}

.stat-success .portal-stat-icon {
    background: rgba(39, 174, 96, 0.1);
    color: var(--portal-success);
}

.stat-warning .portal-stat-icon {
    background: rgba(243, 156, 18, 0.1);
    color: var(--portal-warning);
}

.stat-danger .portal-stat-icon {
    background: rgba(231, 76, 60, 0.1);
    color: var(--portal-danger);
}

.portal-stat-content h4 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--portal-primary);
}

.portal-stat-content p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ----- Publication Cards ----- */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.publication-card {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
    transition: var(--portal-transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.publication-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--portal-shadow-hover);
    text-decoration: none;
    color: inherit;
}

.publication-card .pub-image {
    height: 180px;
    background: var(--portal-primary);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.publication-card .pub-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}

.publication-card .pub-frequency-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--portal-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.publication-card .pub-body {
    padding: 20px;
}

.publication-card .pub-body h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--portal-primary);
}

.publication-card .pub-body p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--portal-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-card .pub-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--portal-text-muted);
    border-top: 1px solid var(--portal-border);
    padding-top: 12px;
}

.publication-card .pub-meta span i {
    margin-right: 4px;
}

.publication-card .pub-actions {
    padding: 0 20px 20px 20px;
}

.publication-card .pub-actions .btn {
    width: 100%;
}

/* ----- Publication Filter/Search ----- */
.publication-filter-bar {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.publication-filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.publication-filter-bar .search-input input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    font-size: 14px;
    outline: none;
    transition: var(--portal-transition);
}

.publication-filter-bar .search-input input:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.publication-filter-bar .search-input i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--portal-text-muted);
}

.publication-filter-bar select {
    padding: 10px 16px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    font-size: 14px;
    color: var(--portal-text);
    background: #fff;
    min-width: 160px;
    outline: none;
}

/* ----- Rate Card Pricing Table ----- */
.rate-card-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}

.rate-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rate-card-table thead th {
    background: var(--portal-primary);
    color: #fff;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rate-card-table thead th:first-child {
    border-radius: var(--portal-radius) 0 0 0;
}

.rate-card-table thead th:last-child {
    border-radius: 0 var(--portal-radius) 0 0;
}

.rate-card-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
}

.rate-card-table tbody tr:hover {
    background: #f7f9fa;
}

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

.rate-card-table .rate-amount {
    font-weight: 700;
    color: var(--portal-primary);
    font-size: 16px;
}

.rate-card-table .rate-per-issue {
    font-size: 11px;
    color: var(--portal-text-muted);
    display: block;
}

.rate-card-table .rate-highlight {
    background: rgba(52, 152, 219, 0.05);
}

.rate-card-table .ad-size-name {
    font-weight: 600;
}

.rate-card-table .ad-size-dims {
    font-size: 12px;
    color: var(--portal-text-muted);
}

.rate-card-table .frequency-header {
    text-align: center;
}

.rate-card-table td.rate-cell {
    text-align: center;
}

.rate-card-note {
    font-size: 13px;
    color: var(--portal-text-muted);
    margin-top: 12px;
    padding: 12px 16px;
    background: #f7f9fa;
    border-radius: var(--portal-radius);
    border-left: 3px solid var(--portal-accent);
}

/* ----- Order Builder ----- */
.order-builder {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

/* Step Indicators */
.order-steps {
    display: flex;
    background: var(--portal-primary);
    padding: 0;
    margin: 0;
    list-style: none;
}

.order-steps li {
    flex: 1;
    text-align: center;
    padding: 18px 12px;
    position: relative;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 500;
    cursor: default;
    transition: var(--portal-transition);
}

.order-steps li .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-right: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--portal-transition);
}

.order-steps li.active {
    color: #fff;
    background: var(--portal-primary-light);
}

.order-steps li.active .step-number {
    background: var(--portal-accent);
}

.order-steps li.completed {
    color: rgba(255, 255, 255, 0.8);
}

.order-steps li.completed .step-number {
    background: var(--portal-success);
}

.order-steps li::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 10px;
    border-color: transparent transparent transparent var(--portal-primary);
    z-index: 1;
}

.order-steps li.active::after {
    border-color: transparent transparent transparent var(--portal-primary-light);
}

.order-steps li:last-child::after {
    display: none;
}

.order-step-panel {
    display: none;
    padding: 30px;
}

.order-step-panel.active {
    display: block;
}

.order-step-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    border-top: 1px solid var(--portal-border);
    background: #fafbfc;
}

/* ----- Order Items Table ----- */
.order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.order-items-table thead th {
    background: var(--portal-bg);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--portal-text-muted);
    text-align: left;
}

.order-items-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--portal-border);
    font-size: 14px;
    vertical-align: middle;
}

.order-items-table tbody tr:hover {
    background: #f7f9fa;
}

.order-items-table .item-remove-btn {
    color: var(--portal-danger);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: var(--portal-radius);
    transition: var(--portal-transition);
}

.order-items-table .item-remove-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* ----- Order Summary ----- */
.order-summary {
    background: #f7f9fa;
    border-radius: var(--portal-radius);
    padding: 24px;
    border: 1px solid var(--portal-border);
}

.order-summary h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--portal-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--portal-border);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.order-summary-row.total-row {
    border-top: 2px solid var(--portal-primary);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--portal-primary);
}

.order-summary-row .label {
    color: var(--portal-text-muted);
}

.order-summary-row .value {
    font-weight: 600;
}

/* ----- File Upload / Drag-and-Drop Zone ----- */
.upload-zone {
    border: 2px dashed var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--portal-transition);
    background: #fafbfc;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--portal-accent);
    background: rgba(52, 152, 219, 0.04);
}

.upload-zone.dragover {
    transform: scale(1.01);
}

.upload-zone .upload-icon {
    font-size: 48px;
    color: var(--portal-accent);
    margin-bottom: 16px;
    display: block;
}

.upload-zone .upload-text {
    font-size: 16px;
    color: var(--portal-text);
    margin-bottom: 8px;
}

.upload-zone .upload-text strong {
    color: var(--portal-accent);
}

.upload-zone .upload-hint {
    font-size: 13px;
    color: var(--portal-text-muted);
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Upload Progress */
.upload-progress-wrap {
    margin-top: 16px;
}

.upload-progress-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--portal-border);
}

.upload-progress-item:last-child {
    border-bottom: none;
}

.upload-progress-item .file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--portal-radius);
    background: var(--portal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--portal-accent);
    flex-shrink: 0;
}

.upload-progress-item .file-info {
    flex: 1;
    min-width: 0;
}

.upload-progress-item .file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-item .file-size {
    font-size: 12px;
    color: var(--portal-text-muted);
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--portal-bg);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.upload-progress-bar .progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--portal-accent);
    transition: width 0.3s ease;
}

.upload-progress-bar .progress-fill.complete {
    background: var(--portal-success);
}

.upload-progress-bar .progress-fill.error {
    background: var(--portal-danger);
}

.upload-progress-item .file-status {
    margin-left: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.upload-progress-item .file-status .status-success {
    color: var(--portal-success);
}

.upload-progress-item .file-status .status-error {
    color: var(--portal-danger);
}

/* ----- Specs Checklist ----- */
.specs-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.specs-checklist li {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--portal-border);
    font-size: 14px;
    transition: var(--portal-transition);
}

.specs-checklist li:last-child {
    border-bottom: none;
}

.specs-checklist li:hover {
    background: #f7f9fa;
}

.specs-checklist li .spec-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 12px;
    flex-shrink: 0;
}

.specs-checklist li .spec-icon.pass {
    background: rgba(39, 174, 96, 0.12);
    color: var(--portal-success);
}

.specs-checklist li .spec-icon.fail {
    background: rgba(231, 76, 60, 0.12);
    color: var(--portal-danger);
}

.specs-checklist li .spec-icon.pending {
    background: rgba(127, 140, 141, 0.12);
    color: var(--portal-text-muted);
}

.specs-checklist li .spec-label {
    flex: 1;
    color: var(--portal-text);
}

.specs-checklist li .spec-value {
    font-size: 13px;
    color: var(--portal-text-muted);
    margin-left: 12px;
    text-align: right;
}

.specs-checklist li .spec-value.pass {
    color: var(--portal-success);
    font-weight: 600;
}

.specs-checklist li .spec-value.fail {
    color: var(--portal-danger);
    font-weight: 600;
}

/* ----- Material Status Timeline ----- */
.material-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 0;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.material-timeline::before {
    content: '';
    position: absolute;
    top: 38px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--portal-border);
    z-index: 0;
}

.material-timeline .timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.material-timeline .timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--portal-border);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--portal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    margin-bottom: 10px;
    transition: var(--portal-transition);
}

.material-timeline .timeline-step.completed .timeline-dot {
    background: var(--portal-success);
    box-shadow: 0 0 0 2px var(--portal-success);
}

.material-timeline .timeline-step.active .timeline-dot {
    background: var(--portal-accent);
    box-shadow: 0 0 0 2px var(--portal-accent), 0 0 0 6px rgba(52, 152, 219, 0.2);
    animation: pulse-dot 2s infinite;
}

.material-timeline .timeline-step.rejected .timeline-dot {
    background: var(--portal-danger);
    box-shadow: 0 0 0 2px var(--portal-danger);
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 2px var(--portal-accent), 0 0 0 6px rgba(52, 152, 219, 0.2);
    }
    50% {
        box-shadow: 0 0 0 2px var(--portal-accent), 0 0 0 10px rgba(52, 152, 219, 0.05);
    }
}

.material-timeline .timeline-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.material-timeline .timeline-step.completed .timeline-label {
    color: var(--portal-success);
}

.material-timeline .timeline-step.active .timeline-label {
    color: var(--portal-accent);
}

.material-timeline .timeline-step.rejected .timeline-label {
    color: var(--portal-danger);
}

.material-timeline .timeline-date {
    font-size: 11px;
    color: var(--portal-text-muted);
    margin-top: 4px;
}

/* Connecting line - filled portion */
.material-timeline .timeline-connector {
    position: absolute;
    top: 38px;
    left: 40px;
    height: 3px;
    background: var(--portal-success);
    z-index: 0;
    transition: width 0.5s ease;
}

/* ----- Status Badges ----- */
.portal-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
}

.portal-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

/* Order statuses */
.portal-badge-draft {
    background: rgba(127, 140, 141, 0.12);
    color: #7f8c8d;
}

.portal-badge-draft .portal-badge-dot {
    background: #7f8c8d;
}

.portal-badge-submitted,
.portal-badge-pending {
    background: rgba(52, 152, 219, 0.12);
    color: var(--portal-accent);
}

.portal-badge-submitted .portal-badge-dot,
.portal-badge-pending .portal-badge-dot {
    background: var(--portal-accent);
}

.portal-badge-under_review,
.portal-badge-in_review {
    background: rgba(243, 156, 18, 0.12);
    color: var(--portal-warning);
}

.portal-badge-under_review .portal-badge-dot,
.portal-badge-in_review .portal-badge-dot {
    background: var(--portal-warning);
}

.portal-badge-approved,
.portal-badge-active {
    background: rgba(39, 174, 96, 0.12);
    color: var(--portal-success);
}

.portal-badge-approved .portal-badge-dot,
.portal-badge-active .portal-badge-dot {
    background: var(--portal-success);
}

.portal-badge-rejected,
.portal-badge-revision_needed,
.portal-badge-cancelled {
    background: rgba(231, 76, 60, 0.12);
    color: var(--portal-danger);
}

.portal-badge-rejected .portal-badge-dot,
.portal-badge-revision_needed .portal-badge-dot,
.portal-badge-cancelled .portal-badge-dot {
    background: var(--portal-danger);
}

.portal-badge-completed {
    background: rgba(44, 62, 80, 0.10);
    color: var(--portal-primary);
}

.portal-badge-completed .portal-badge-dot {
    background: var(--portal-primary);
}

/* ----- Portal Buttons ----- */
.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--portal-radius);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--portal-transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-portal i {
    margin-right: 8px;
}

.btn-portal-primary {
    background: var(--portal-accent);
    color: #fff;
}

.btn-portal-primary:hover {
    background: var(--portal-accent-hover);
    color: #fff;
    text-decoration: none;
}

.btn-portal-secondary {
    background: var(--portal-bg);
    color: var(--portal-text);
    border: 1px solid var(--portal-border);
}

.btn-portal-secondary:hover {
    background: #dfe4e6;
    color: var(--portal-text);
    text-decoration: none;
}

.btn-portal-success {
    background: var(--portal-success);
    color: #fff;
}

.btn-portal-success:hover {
    background: #219a52;
    color: #fff;
    text-decoration: none;
}

.btn-portal-danger {
    background: var(--portal-danger);
    color: #fff;
}

.btn-portal-danger:hover {
    background: #c0392b;
    color: #fff;
    text-decoration: none;
}

.btn-portal-outline {
    background: transparent;
    color: var(--portal-accent);
    border: 2px solid var(--portal-accent);
}

.btn-portal-outline:hover {
    background: var(--portal-accent);
    color: #fff;
    text-decoration: none;
}

.btn-portal-sm {
    padding: 6px 16px;
    font-size: 12px;
}

.btn-portal-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ----- Portal Forms ----- */
.portal-form-group {
    margin-bottom: 20px;
}

.portal-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-form-group label .required {
    color: var(--portal-danger);
}

.portal-form-group .form-control {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--portal-transition);
    width: 100%;
}

.portal-form-group .form-control:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.portal-form-group .help-text {
    margin-top: 4px;
    font-size: 12px;
    color: var(--portal-text-muted);
}

.portal-form-group .error-text {
    margin-top: 4px;
    font-size: 12px;
    color: var(--portal-danger);
    display: none;
}

.portal-form-group.has-error .form-control {
    border-color: var(--portal-danger);
}

.portal-form-group.has-error .error-text {
    display: block;
}

/* ----- Portal Tables ----- */
.portal-table-wrap {
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table thead th {
    background: var(--portal-bg);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--portal-text-muted);
    text-align: left;
    border-bottom: 2px solid var(--portal-border);
}

.portal-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
}

.portal-table tbody tr:hover {
    background: #f7f9fa;
}

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

/* ----- Empty State ----- */
.portal-empty-state {
    text-align: center;
    padding: 60px 24px;
}

.portal-empty-state .empty-icon {
    font-size: 60px;
    color: var(--portal-border);
    margin-bottom: 16px;
}

.portal-empty-state h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-empty-state p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--portal-text-muted);
}

/* ----- Confirm Dialogs (overlay) ----- */
.portal-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--portal-transition);
}

.portal-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.portal-confirm-dialog {
    background: var(--portal-card-bg);
    border-radius: var(--portal-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.portal-confirm-dialog h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

.portal-confirm-dialog p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--portal-text-muted);
}

.portal-confirm-dialog .confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ----- Responsive ----- */
@media (max-width: 991px) {
    .portal-sidebar {
        margin-bottom: 24px;
    }

    .order-steps li .step-label {
        display: none;
    }

    .order-steps li .step-number {
        margin-right: 0;
    }

    .material-timeline {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 30px;
    }

    .material-timeline::before {
        top: 0;
        bottom: 0;
        left: 13px;
        width: 3px;
        height: auto;
        right: auto;
    }

    .material-timeline .timeline-step {
        flex-direction: row;
        align-items: center;
        margin-bottom: 24px;
    }

    .material-timeline .timeline-dot {
        margin-bottom: 0;
        margin-right: 14px;
    }

    .material-timeline .timeline-connector {
        top: 0;
        left: 13px;
        width: 3px !important;
        height: auto;
    }
}

@media (max-width: 767px) {
    .portal-stats-row {
        grid-template-columns: 1fr;
    }

    .publications-grid {
        grid-template-columns: 1fr;
    }

    .portal-card-body {
        padding: 16px;
    }

    .order-step-panel {
        padding: 20px;
    }

    .order-step-actions {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
    }

    .order-step-actions .btn-portal {
        width: 100%;
    }

    .publication-filter-bar {
        flex-direction: column;
    }

    .publication-filter-bar .search-input {
        width: 100%;
    }

    .publication-filter-bar select {
        width: 100%;
    }

    .portal-page-header h1 {
        font-size: 20px;
    }

    .portal-stat-card {
        padding: 16px;
    }

    .portal-stat-content h4 {
        font-size: 22px;
    }

    .rate-card-table {
        font-size: 13px;
    }

    .rate-card-table thead th,
    .rate-card-table tbody td {
        padding: 8px 10px;
    }

    .portal-confirm-dialog .confirm-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .order-steps {
        flex-wrap: wrap;
    }

    .order-steps li {
        flex: 0 0 50%;
        padding: 12px 8px;
        font-size: 12px;
    }

    .order-steps li::after {
        display: none;
    }

    .portal-container {
        padding: 0 12px;
    }

    .publication-card .pub-image {
        height: 140px;
    }

    .upload-zone {
        padding: 24px 16px;
    }

    .upload-zone .upload-icon {
        font-size: 36px;
    }
}
