/* Portal Login Page */
.portal-login-area {
    min-height: 100vh;
    background: linear-gradient(135deg, #183749 0%, #0f2a38 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.portal-login-box {
    padding: 60px 50px;
}

.portal-logo {
    text-align: center;
    margin-bottom: 30px;
}

.portal-logo img {
    max-width: 180px;
}

.portal-login-box h2 {
    font-size: 32px;
    color: #183749;
    margin-bottom: 10px;
    text-align: center;
}

.portal-login-box > p {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.portal-form .form-group {
    margin-bottom: 25px;
    position: relative;
}

.portal-form label {
    display: block;
    color: #183749;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.portal-form label i {
    color: #6366f1;
    margin-right: 5px;
}

.portal-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.portal-form input[type="password"].form-control {
    padding-right: 45px;
}

.portal-form .form-control:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 42px;
    cursor: pointer;
    color: #999;
    font-size: 18px;
}

.toggle-password:hover {
    color: #183749;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
}

.forgot-link {
    color: #6366f1;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.portal-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.portal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

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

.portal-footer {
    margin-top: 30px;
    text-align: center;
}

.portal-footer p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.portal-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.portal-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #28a745;
    font-size: 13px;
}

.portal-security i {
    font-size: 18px;
}

.portal-info {
    background: linear-gradient(135deg, #183749 0%, #0f2a38 100%);
    padding: 60px 50px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-info h3 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #ffffff;
}

.portal-info ul {
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
}

.portal-info ul li {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.portal-info ul li i {
    color: #6366f1;
    font-size: 20px;
}

.portal-support {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.portal-support i {
    font-size: 32px;
    color: #6366f1;
}

.portal-support strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.portal-support p {
    margin: 0;
    font-size: 14px;
}

.portal-support a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

/* Portal Dashboard */
.portal-dashboard {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    width: 100%;
}

.portal-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1f36 0%, #0f1419 100%);
    color: #ffffff;
    padding: 30px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: transform 0.3s ease;
    z-index: 1000;
    left: 0;
    top: 0;
}

.portal-sidebar.mobile-hidden {
    transform: translateX(-100%);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.mobile-menu-dropdown {
    display: none;
    position: fixed;
    top: 75px;
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu-dropdown.active {
    display: block;
}

.mobile-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #183749;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-dropdown a:hover {
    background: #f8f9fa;
    color: #6366f1;
}

.mobile-menu-dropdown a i {
    font-size: 18px;
    width: 20px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

.portal-sidebar::-webkit-scrollbar {
    display: none;
}

.portal-sidebar-logo {
    padding: 0 30px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.portal-sidebar-logo img {
    max-width: 150px;
}

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

.portal-nav li {
    margin-bottom: 5px;
}

.portal-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 30px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.portal-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #6366f1;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.portal-nav a:hover,
.portal-nav a.active {
    background: rgba(102,126,234,0.15);
    color: #6366f1;
    transform: translateX(5px);
}

.portal-nav a:hover::before,
.portal-nav a.active::before {
    transform: scaleY(1);
}

.portal-nav i {
    font-size: 20px;
    width: 24px;
}

.portal-main {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
}

.portal-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    animation: slideDown 0.5s ease;
}

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

.portal-header h1 {
    font-size: 28px;
    color: #183749;
    margin: 0;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.portal-user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.portal-user-info h4 {
    margin: 0;
    font-size: 15px;
    color: #183749;
}

.portal-user-info p {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.portal-logout {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    transition: all 0.3s ease;
}

.portal-logout:hover {
    transform: scale(1.2);
    color: #8b5cf6;
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.portal-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 4px solid #6366f1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.portal-card:nth-child(1) { animation-delay: 0.1s; }
.portal-card:nth-child(2) { animation-delay: 0.2s; }
.portal-card:nth-child(3) { animation-delay: 0.3s; }
.portal-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(102,126,234,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102,126,234,0.2);
}

.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.portal-card-header h3 {
    font-size: 14px;
    color: #999;
    margin: 0;
    text-transform: uppercase;
    font-weight: 600;
}

.portal-card-header i {
    font-size: 24px;
    color: #6366f1;
    transition: all 0.3s ease;
}

.portal-card:hover .portal-card-header i {
    transform: scale(1.2) rotate(10deg);
    color: #8b5cf6;
}

.portal-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #183749;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portal-card-label {
    font-size: 13px;
    color: #666;
}

.portal-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.portal-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f7fa;
}

.portal-section-header h2 {
    font-size: 22px;
    color: #183749;
    margin: 0;
}

.portal-section-header .btn-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.portal-section-header .btn-link:hover {
    color: #8b5cf6;
    transform: translateX(5px);
}

.case-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.case-item {
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.case-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.case-item:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 30px rgba(102,126,234,0.15);
    transform: translateX(5px);
}

.case-item:hover::before {
    transform: scaleY(1);
}

.case-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.case-item-header h4 {
    font-size: 16px;
    color: #183749;
    margin: 0;
}

.case-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.case-status:hover {
    transform: scale(1.05);
}

.case-status.active {
    background: #d4edda;
    color: #155724;
}

.case-status.pending {
    background: #fff3cd;
    color: #856404;
}

.case-status.closed {
    background: #d1ecf1;
    color: #0c5460;
}

.case-item-details {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.case-item-details span i {
    color: #6366f1;
    margin-right: 5px;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.document-item:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 30px rgba(102,126,234,0.15);
    transform: translateY(-3px);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.document-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.document-details h5 {
    margin: 0 0 5px;
    font-size: 15px;
    color: #183749;
    transition: color 0.3s ease;
}

.document-item:hover .document-details h5 {
    color: #6366f1;
}

.document-details p {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.document-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
}

.btn-icon:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: #6366f1;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

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

.portal-section table th {
    background: #f5f7fa;
    padding: 12px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #183749;
    border-bottom: 2px solid #e5e5e5;
}

.portal-section table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 14px;
    color: #666;
}

.portal-section table tbody tr {
    transition: all 0.3s ease;
}

.portal-section table tbody tr:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.05) 0%, transparent 100%);
    transform: scale(1.01);
}

.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h3 {
    margin: 0 0 20px;
    color: #183749;
}

.modal-content .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-content .close:hover {
    color: #183749;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    color: #183749;
    font-weight: 600;
    font-size: 14px;
}

.modal-content .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.modal-content small {
    color: #999;
    font-size: 12px;
}

@media (max-width: 991px) {
    .portal-login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .portal-info {
        display: none;
    }
    
    .portal-login-box {
        padding: 40px 30px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    .portal-sidebar {
        display: none;
    }
    
    .portal-main {
        margin-left: 0;
        padding: 80px 15px 15px;
        width: 100%;
        min-width: 0;
    }
    
    .portal-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .portal-section table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .portal-header {
        padding: 15px 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .portal-login-area {
        padding: 15px;
    }
    
    .portal-login-container {
        max-width: 100%;
    }
    
    .portal-login-box {
        padding: 30px 20px;
    }
    
    .portal-login-box h2 {
        font-size: 26px;
    }
    
    .portal-logo img {
        max-width: 150px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .portal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .portal-header h1 {
        font-size: 22px;
    }
    
    .portal-user {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 10px;
    }
    
    .portal-user-info {
        text-align: center;
        min-width: 120px;
    }
    
    .portal-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .portal-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .portal-section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .portal-section-header .btn-link,
    .portal-section-header button {
        width: 100%;
        text-align: center;
        padding: 10px;
        border-radius: 6px;
        background: #f8f9fa;
        border: 1px solid #e5e5e5;
    }
    
    .case-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .case-item-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .document-item {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .document-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .portal-section table th,
    .portal-section table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    #currencySelector {
        width: 100%;
        margin-bottom: 10px;
        order: -1;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
        margin: 10px;
    }
    
    .modal-content h3 {
        font-size: 18px;
    }
    
    .portal-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Chart cards responsive */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    #casesChart, #revenueChart {
        max-height: 250px !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .portal-login-box {
        padding: 30px 20px;
    }
    
    .portal-login-box h2 {
        font-size: 24px;
    }
    
    .portal-main {
        padding: 70px 10px 10px;
    }
    
    .portal-header {
        padding: 12px;
    }
    
    .portal-header h1 {
        font-size: 18px;
    }
    
    .portal-card {
        padding: 20px;
    }
    
    .portal-card-value {
        font-size: 24px;
    }
    
    .portal-section {
        padding: 15px 10px;
    }
    
    .portal-section-header h2 {
        font-size: 18px;
    }
    
    .case-item {
        padding: 15px;
    }
    
    .modal-content {
        width: 98%;
        padding: 12px;
    }
    
    /* Chart cards for small mobile */
    #casesChart, #revenueChart {
        max-height: 200px !important;
    }
    
    .portal-section canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}
