@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #060814;
    --bg-rail: #0a0c1e;
    --card-bg: rgba(255, 255, 255, 0.035);
    --card-bg-hover: rgba(255, 255, 255, 0.06);
    --card-bg-strong: #0d1026;
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(243, 52, 67, 0.4);
    --input-bg: rgba(255, 255, 255, 0.02);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus-border: var(--primary);
    --input-focus-glow: rgba(243, 52, 67, 0.2);
    --primary: #ff2a54;
    --primary-glow: rgba(255, 42, 84, 0.25);
    --primary-hover: #ff4d73;
    --accent: #ffd166;
    --accent-glow: rgba(255, 209, 102, 0.2);
    --teal: #06d6a0;
    --text-main: #f3f5f9;
    --text-muted: #8e95aa;
    --text-inverse: #060814;
    --success: #06D6A0;
    --success-glow: rgba(6, 214, 160, 0.2);
    --warning: #ffd166;
    --warning-glow: rgba(255, 209, 102, 0.2);
    --danger: #ef476f;
    --danger-glow: rgba(239, 71, 111, 0.2);
    --status-error: #ef476f;
    --sidebar-width: 280px;
    --header-height: 80px;
    --radius: 16px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-main);
    background: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 42, 84, 0.06) 0%, transparent 40%),
        #060814;
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Glassmorphism containers */
.glass-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
}

.glass-container:hover {
    background: var(--card-bg-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation Styling */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--card-border);
    background: rgba(10, 12, 30, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    min-height: 90px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.sidebar-logo svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.brand-text {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(120deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-item {
    list-style: none;
}

.nav-item a {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-item a svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.nav-item a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-item.active a {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, rgba(255, 42, 84, 0.15) 0%, rgba(255, 42, 84, 0.03) 100%);
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
    padding: 18px 16px 24px;
    border-top: 1px solid var(--card-border);
}

/* Main Workspace Panel */
.main-panel {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-speed) ease;
}

/* Header Component */
.main-header {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 40px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(6, 8, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left,
.header-right,
.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.page-title {
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
}

.user-role {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.content-body {
    padding: 40px;
    flex: 1;
}

/* Premium Custom Buttons */
.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, var(--primary), #e60036);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #ff1a4d);
    box-shadow: 0 8px 30px rgba(255, 42, 84, 0.4);
}

.btn-secondary {
    border-color: var(--card-border);
    background: rgba(255, 255, 255, 0.04);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #cc1b43);
    box-shadow: 0 8px 24px var(--danger-glow);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5c82, #ef476f);
    box-shadow: 0 8px 30px rgba(239, 71, 111, 0.4);
}

.btn-icon {
    width: 46px;
    padding: 0;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Premium Inputs */
.form-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input,
.form-input-custom,
.search-input,
.filter-select {
    width: 100%;
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius) !important;
    color: var(--text-main);
    background: var(--input-bg) !important;
    padding: 14px 18px;
    font-size: 0.95rem;
    outline: 0;
    transition: all 0.25s ease;
}

.form-input:focus,
.form-input-custom:focus,
.search-input:focus,
.filter-select:focus {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 3px var(--input-focus-glow) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

select option {
    color: var(--text-main);
    background: var(--card-bg-strong);
}

/* Premium Toast Alerts */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: grid;
    gap: 12px;
}

.toast {
    width: min(400px, calc(100vw - 48px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 1px solid var(--card-border);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius);
    background: rgba(13, 16, 38, 0.95);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 42, 84, 0.15);
    flex-shrink: 0;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 800;
}

.toast-desc {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.toast-success {
    border-left-color: var(--success);
}

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

.toast-success .toast-icon svg {
    fill: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

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

.toast-error .toast-icon svg {
    fill: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning .toast-icon {
    background: var(--warning-glow);
}

.toast-warning .toast-icon svg {
    fill: var(--warning);
}

/* Loading Spinners */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    background: rgba(6, 8, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3.5px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary);
    border-bottom-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Premium Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: opacity var(--transition-speed) ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    width: min(650px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: #0b0e22;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--card-border);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--card-border);
    border-bottom: 0;
    background: rgba(0, 0, 0, 0.15);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* Input Tab Layouts & Drag-Drop File Uploads */
.tabs-container {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 10px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-content.hidden {
    display: none;
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-input-hidden {
    display: none;
}

.file-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    text-align: center;
}

.file-drop-zone:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(255, 42, 84, 0.03);
}

.file-drop-zone svg {
    width: 36px;
    height: 36px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.file-drop-zone:hover svg {
    transform: translateY(-3px);
}

.file-drop-zone span {
    font-size: 0.82rem;
    font-weight: 700;
}

.upload-progress-bar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    height: 18px;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-progress-bar-container.hidden {
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    width: 0%;
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.15s linear;
}

.upload-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-file-info.hidden {
    display: none;
}

.upload-file-name {
    font-size: 0.84rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
    font-weight: 700;
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    transition: all var(--transition-speed) ease;
}

.btn-remove-file:hover {
    background: rgba(239, 71, 111, 0.12);
}

/* Media Responsive Queries */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--primary-glow);
    }

    .main-panel {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: grid;
    }
}

@media (max-width: 640px) {
    .content-body {
        padding: 24px 16px;
    }

    .main-header {
        padding: 0 16px;
    }

    .page-title {
        max-width: 55vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1.15rem;
    }

    .user-info {
        display: none;
    }
}
