/* SAHU INDUSTRY — CENTRAL DESIGN SYSTEM STYLES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #060f22;
    --sidebar-bg: #060e1d;
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.05);
    
    /* Premium Violet/Purple Design Accent & Gradient */
    --accent: #B040FF;
    --accent-glow: transparent;
    --accent-gradient: #B040FF;
    --hover-gradient: #C56BFF;
    
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    
    --success: #00ff88;
    --success-bg: rgba(0, 255, 136, 0.15);
    --success-border: rgba(0, 255, 136, 0.3);
    
    --warning: #ffcc00;
    --warning-bg: rgba(255, 204, 0, 0.15);
    --warning-border: rgba(255, 204, 0, 0.3);
    
    --danger: #ff4444;
    --danger-bg: rgba(255, 68, 68, 0.15);
    --danger-border: rgba(255, 68, 68, 0.3);

    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ── LAYOUT ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 35px 25px;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 25px 15px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.nav-link i {
    font-style: normal;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(176, 64, 255, 0.1);
    color: #fff;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
}

/* Accordion Nav Dropdown & Sublinks Styling */
.nav-dropdown {
    margin-bottom: 8px;
}
.nav-dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid rgba(176, 64, 255, 0.5);
    border-radius: 0 12px 12px 0;
}
.nav-dropdown-menu {
    border-left: 1px dashed rgba(176, 64, 255, 0.2);
    margin-left: 28px;
    padding-left: 10px !important;
}
.sub-nav-link {
    font-size: 13px !important;
    padding: 10px 15px !important;
    margin-bottom: 4px !important;
}
.sub-nav-link.active {
    background: rgba(176, 64, 255, 0.15) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: 0 8px 8px 0 !important;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--card-border);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 60px;
    max-width: 1600px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 45px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 6px;
}

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

.profile-info {
    text-align: right;
}

.profile-info .name {
    font-weight: 600;
    font-size: 14px;
}

.profile-info .role {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* ── STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .label {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-card .icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 32px;
    opacity: 0.05;
}

/* ── CARDS & SECTIONS ── */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    overflow: hidden; /* Keep all content bound within premium rounded card corners */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── TABLES ── */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 12px; /* Ensure table scroll wrapper itself has clean rounded corners */
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 700;
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.new, .status-badge.assigned {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.status-badge.in-progress {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.status-badge.completed, .status-badge.active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-badge.cancelled, .status-badge.rejected, .status-badge.inactive {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.btn-primary, .btn-success, .btn-danger {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(176, 64, 255, 0.3);
}

.btn-primary:hover, .btn-success:hover, .btn-danger:hover {
    background: var(--hover-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 6px 20px rgba(176, 64, 255, 0.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ── FORM ELEMENTS ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: var(--transition);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23B040FF' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 45px !important;
    cursor: pointer;
}

select option {
    background-color: #08101d; /* Matches portal dark card background */
    color: #ffffff;
    font-size: 14px;
    padding: 10px;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 10px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── MODALS (OVERLAYS) ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #08101d;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 650px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: #fff;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #fff;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

/* ── TIMELINE TRACKER ── */
.timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 40px 0;
    padding: 0 20px;
}

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

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

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: bold;
    transition: var(--transition);
}

.timeline-step.active .timeline-icon {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.timeline-step.completed .timeline-icon {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.timeline-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.timeline-step.active .timeline-label {
    color: #fff;
}

/* ── EMPTY STATES ── */
.empty-state {
    text-align: center;
    padding: 50px 0;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 40px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.2;
}

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 14px 25px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.toast::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0; top: 0;
    border-radius: 12px 0 0 12px;
    background: var(--accent-gradient);
}

.toast.success::before {
    background: var(--success);
}

.toast.error::before {
    background: var(--danger);
}

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

/* ── MOBILE RESPONSIVENESS ── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 80px 20px 40px;
    }
    .mobile-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        padding: 20px;
    }
}
