/* ========================================
   SetiniSec CRM - Design System
   Modern Admin Panel Theme
   ======================================== */

/* ---- CSS Variables ---- */
:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Colors */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-bg: rgba(79, 70, 229, 0.08);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.08);

    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: rgba(79, 70, 229, 0.2);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;

    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.sidebar-logo-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.login-logo-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto 15px auto;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    padding: 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13.5px;
    transition: all var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active .nav-icon {
    color: var(--primary-light);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    color: var(--sidebar-text);
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    letter-spacing: -0.3px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Content Area ---- */
.content-area {
    padding: 24px;
    flex: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-outline {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.card-body {
    padding: 20px;
}

.card-action {
    border: 2px solid var(--primary);
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.02), var(--surface));
}

.card-total {
    background: linear-gradient(135deg, var(--sidebar-bg), #1e293b);
    color: white;
    border: none;
}

.card-header-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.header-stat {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ---- Stats Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-default .stat-icon {
    background: var(--border-light);
    color: var(--text-secondary);
}

.stat-primary .stat-icon {
    background: var(--primary-bg);
    color: var(--primary);
}

.stat-success .stat-icon {
    background: var(--success-bg);
    color: var(--success);
}

.stat-danger .stat-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-warning .stat-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-info .stat-icon {
    background: var(--info-bg);
    color: var(--info);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.table thead th {
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.totals-row {
    background: var(--bg) !important;
    font-weight: 600;
}

.totals-row td {
    border-top: 2px solid var(--border);
}

.table-snapshot {
    background: #fffbeb;
}

.table-snapshot th {
    background: #fef3c7;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.badge-lg {
    padding: 6px 14px;
    font-size: 12px;
}

.badge-small {
    padding: 1px 6px;
    font-size: 10px;
}

.badge-draft {
    background: #f1f5f9;
    color: #64748b;
}

.badge-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-revision {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: all var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.flex-grow {
    flex: 1;
    min-width: 200px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 0;
    flex-wrap: wrap;
}

/* ---- Filters ---- */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.filter-form .form-group {
    margin-bottom: 0;
}

/* ---- Proposal Items Table ---- */
.proposal-items-table .form-control {
    min-width: 90px;
    padding: 7px 10px;
    font-size: 12px;
}

.proposal-items-table td {
    padding: 6px 4px;
    vertical-align: middle;
}

.proposal-items-table .calc-revenue,
.proposal-items-table .calc-cost,
.proposal-items-table .calc-profit {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    min-width: 90px;
}

.proposal-items-table .calc-profit {
    color: var(--success);
}

/* ---- Grade-Based Sections ---- */
.grade-section { border: 1px solid var(--border); }
.grade-section .grade-header { display: flex; align-items: center; justify-content: space-between; }
.grade-section .card-actions { display: flex; gap: 6px; align-items: center; }
.grade-section .grade-body { transition: max-height 0.3s ease, opacity 0.2s ease; overflow: hidden; }
.grade-section.collapsed .grade-body { display: none; }
.grade-section.collapsed { opacity: 0.8; }
.grade-section.collapsed .grade-header { border-bottom: none; }

/* ---- Row field labels ---- */
.row-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; font-weight: 500; }
.row-summary { transition: background 0.2s; }

/* ---- Manual Product Highlight ---- */
.manual-product-row {
    background: rgba(239, 68, 68, 0.08) !important;
    border-radius: var(--radius);
}

.row-publisher {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Proposal Meta ---- */
.proposal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-left,
.meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Summary Cards ---- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.summary-highlight {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    border-color: var(--warning);
}

.summary-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ---- Detail Grid ---- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

/* ---- Info Grid ---- */
.info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    font-size: 13px;
    color: var(--text);
}

.highlight-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--warning);
}

/* ---- Decision Actions ---- */
.decision-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* ---- Activity List ---- */
.activity-list {
    padding: 0 20px 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- File List ---- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.file-name {
    font-weight: 600;
    font-size: 13px;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-uploader {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Version List ---- */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    transition: background var(--transition);
}

a.version-item:hover {
    background: var(--bg);
    color: var(--text);
}

.version-current {
    background: var(--primary-bg);
    font-weight: 600;
}

/* ---- Grand Total Grid ---- */
.grand-total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.grand-total-item {
    text-align: center;
}

.gt-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gt-value {
    font-size: 22px;
    font-weight: 800;
    color: white;
    margin-top: 4px;
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---- Login Page ---- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e293b 50%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-top: 16px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.logo-icon-lg {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: white;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

/* ---- Page Actions ---- */
.page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

/* ---- Quick Actions ---- */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    margin-top: 16px;
    color: var(--text);
}

.empty-state p {
    color: var(--text-muted);
    margin: 8px 0 24px;
}

/* ---- Overlay for mobile sidebar ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ---- Utility Classes ---- */
.mt-4 {
    margin-top: 20px;
}

.mb-4 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 16px;
}

.ml-1 {
    margin-left: 4px;
}

.py-4 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-nowrap {
    white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 18px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        /* fixes the search bar and inputs aligning to the right */
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .decision-actions {
        flex-direction: column;
    }

    .decision-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .proposal-items-table {
        font-size: 11px;
    }

    .proposal-items-table .form-control {
        min-width: 70px;
        padding: 5px 6px;
        font-size: 11px;
    }

    .grand-total-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-title {
        font-size: 15px;
    }

    .meta-left,
    .meta-right {
        width: 100%;
    }

    .quick-actions,
    .page-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .quick-actions .btn,
    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header-stats {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .grand-total-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 28px 20px;
    }
}

/* ---- Print ---- */
@media print {

    .sidebar,
    .topbar,
    .page-actions,
    .form-actions,
    .btn,
    .hamburger {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   NEW: Checkbox System
   ======================================== */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 0;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 24px;
}

/* ========================================
   NEW: Section Subtitles
   ======================================== */
.section-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.mt-3 {
    margin-top: 12px;
}

.mt-2 {
    margin-top: 8px;
}

/* ========================================
   NEW: Form Grid Layouts
   ======================================== */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   NEW: Cost Summary & Breakdown
   ======================================== */
.cost-summary {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.cost-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cost-summary-item span {
    color: var(--text-secondary);
}

.cost-summary-highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.cost-breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: var(--radius);
}

.cost-row span {
    color: var(--text-secondary);
}

.cost-row-sub {
    background: var(--bg);
    font-weight: 600;
}

.cost-row-total {
    background: var(--sidebar-bg);
    color: white;
    font-weight: 700;
    font-size: 16px;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-top: 4px;
}

.cost-row-total span {
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   NEW: Set Content Display
   ======================================== */
.set-content-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.set-item {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   NEW: Institution Summary (CEO view)
   ======================================== */
.institution-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.inst-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inst-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.inst-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.institution-card:hover {
    border-color: var(--primary);
}

/* ========================================
   NEW: File Actions Group
   ======================================== */
.file-actions-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ========================================
   NEW: Excel Preview
   ======================================== */
#excelPreviewContent .table {
    font-size: 12px;
}

#excelPreviewContent .table th {
    background: #e0e7ff;
    color: var(--primary-dark);
    font-size: 11px;
}

#excelPreviewContent .table td {
    padding: 6px 10px;
}

.mt-4 {
    margin-top: 20px;
}

/* ========================================
   Sipariş Takip (Order Tracking)
   ======================================== */

/* Progress bar */
.order-progress-bar {
    width: 80px;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.order-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.order-collapse-icon {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.2s;
    user-select: none;
}

/* Institution list in order detail */
.order-institution-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-inst-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.order-inst-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.order-inst-item.ordered {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.25);
}

.order-inst-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-inst-qty {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.order-inst-status {
    text-align: right;
    min-width: 140px;
}

/* Custom Checkbox for order tracking */
.order-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.order-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.order-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--surface);
}

.order-checkbox:checked + .order-checkmark {
    background: linear-gradient(135deg, var(--success), #34d399);
    border-color: var(--success);
}

.order-checkbox:checked + .order-checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.order-checkbox:focus + .order-checkmark {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Product row styling */
.order-product-row:hover {
    background: rgba(79, 70, 229, 0.02);
}

/* ========================================
   Evrak / Ciro Hesabı (Publisher Cost Report)
   ======================================== */

.cost-publisher-card .card-header:hover {
    background: var(--surface-hover);
}

.cost-detail-row td {
    padding: 0 !important;
}

.cost-detail-row .table {
    margin-bottom: 0;
}

.cost-detail-row .table td,
.cost-detail-row .table th {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========================================
   Shared: Empty state improvements
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ========================================
   Responsive: Order & Cost pages
   ======================================== */
@media (max-width: 768px) {
    .order-inst-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .order-inst-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .order-inst-status {
        min-width: auto;
        text-align: left;
    }
    
    .order-progress-bar {
        width: 50px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}
