/* ========================================
   Self Service Portal - Custom Styles
   ======================================== */

:root {
    --portal-primary: #002050;
    --portal-primary-light: #003080;
    --portal-secondary: #6c757d;
    --portal-success: #28a745;
    --portal-danger: #dc3545;
    --portal-warning: #ffc107;
    --portal-info: #17a2b8;
    --portal-bg: #f4f7fa;
    --portal-sidebar-width: 250px;
    --portal-navbar-height: 60px;
}

/* === Layout === */
.portal-body {
    background-color: var(--portal-bg);
    font-family: 'MarkPro', 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    margin: 0;
    padding: 0;
}

.portal-wrapper {
    display: flex;
    min-height: calc(100vh - var(--portal-navbar-height));
}

/* === Navbar === */
.portal-navbar {
    background: var(--portal-primary);
    height: var(--portal-navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.portal-navbar .portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.portal-navbar .portal-brand img {
    height: 36px;
}

.portal-navbar .portal-brand span {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.portal-navbar .portal-user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portal-navbar .portal-user-menu .user-name {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.portal-navbar .portal-user-menu .btn-portal-logout {
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    text-decoration: none;
    transition: color 0.2s;
}

.portal-navbar .portal-user-menu .btn-portal-logout:hover {
    color: #fff;
}

/* === Sidebar === */
.portal-sidebar {
    width: var(--portal-sidebar-width);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 20px 0;
    flex-shrink: 0;
    min-height: calc(100vh - var(--portal-navbar-height));
}

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

.portal-sidebar .nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.portal-sidebar .nav-menu li a:hover {
    background: #f8fafc;
    color: var(--portal-primary);
    border-left-color: var(--portal-primary);
}

.portal-sidebar .nav-menu li a.active {
    background: #eef2f7;
    color: var(--portal-primary);
    border-left-color: var(--portal-primary);
    font-weight: 500;
}

.portal-sidebar .nav-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.portal-sidebar .nav-section-title {
    padding: 16px 24px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #a0aec0;
    letter-spacing: 0.5px;
}

/* === Content === */
.portal-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

.portal-page-header {
    margin-bottom: 24px;
}

.portal-page-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.portal-page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 13px;
}

/* === KPI Cards === */
.portal-kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s;
}

.portal-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.portal-kpi-card .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.portal-kpi-card .kpi-icon.bg-orders { background: var(--portal-primary); }
.portal-kpi-card .kpi-icon.bg-offers { background: var(--portal-warning); }
.portal-kpi-card .kpi-icon.bg-demands { background: var(--portal-info); }
.portal-kpi-card .kpi-icon.bg-invoices { background: var(--portal-success); }

.portal-kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
}

.portal-kpi-card .kpi-label {
    font-size: 14px;
    color: #718096;
    margin-top: 4px;
}

/* === Cards === */
.portal-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.portal-card .card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    color: #1a202c;
}

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

/* === Tables === */
.portal-table {
    width: 100%;
}

.portal-table thead th {
    background: #f8fafc;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e5e7eb;
    padding: 12px 16px;
}

.portal-table tbody td {
    padding: 12px 16px;
    font-size: 15px;
    color: #2d3748;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

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

/* === Status Badges === */
.portal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.portal-badge-success { background: #dcfce7; color: #166534; }
.portal-badge-warning { background: #fef3c7; color: #92400e; }
.portal-badge-danger { background: #fee2e2; color: #991b1b; }
.portal-badge-info { background: #dbeafe; color: #1e40af; }
.portal-badge-secondary { background: #f3f4f6; color: #4b5563; }

/* === Buttons === */
.btn-portal-primary {
    background: var(--portal-primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

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

/* === Login Page === */
.portal-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-primary) 0%, #001030 100%);
}

.portal-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.portal-login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.portal-login-card .login-logo img {
    height: 60px;
}

.portal-login-card .login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
}

.portal-login-card .login-subtitle {
    text-align: center;
    font-size: 14px;
    color: #718096;
    margin-bottom: 32px;
}

.portal-login-card .form-control {
    border-radius: 6px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

.portal-login-card .form-control:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(0, 32, 80, 0.1);
}

.portal-login-card .btn-login {
    width: 100%;
    background: var(--portal-primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

.portal-login-card .btn-login:hover {
    background: var(--portal-primary-light);
}

/* === Footer === */
.portal-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #a0aec0;
    border-top: 1px solid #e5e7eb;
}

/* === Responsive === */
@media (max-width: 768px) {
    .portal-sidebar {
        display: none;
    }
    .portal-content {
        padding: 16px;
    }
}
