:root {
    /* TEMA CORPORATE PRO */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #0f766e;
    --accent-icon: #0d9488;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 10px;
}

body.theme-aurora {
    --primary: #4a90e2;
    --secondary: #50e3c2;
    --accent: #ff6b6b;
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --sidebar-text: #777777;
    --sidebar-text-active: #4a90e2;
    --text-main: #333333;
    --text-light: #777777;
    --border: #e1e4e8;
}

body.theme-dark {
    --primary: #3b82f6;
    --secondary: #9ca3af;
    --accent: #ef4444;
    --bg-body: #111827;
    --bg-card: #1f2937;
    --bg-sidebar: #0f172a;
    --sidebar-text: #9ca3af;
    --sidebar-text-active: #ffffff;
    --text-main: #f3f4f6;
    --text-light: #9ca3af;
    --border: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* --- LOGIN --- */
#login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: fixed;
    width: 100%;
    z-index: 1000;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.75) 0%, rgba(15, 25, 50, 0.75) 100%),
        url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1920&q=80') center/cover;
    background-attachment: fixed;
    animation: bgShift 15s ease-in-out infinite;
}

@keyframes bgShift {

    0%,
    100% {
        filter: brightness(1) contrast(1);
    }

    50% {
        filter: brightness(1.05) contrast(1.02);
    }
}

#login-section::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 50%;
    top: -100px;
    left: -100px;
    filter: blur(40px);
    animation: float1 8s ease-in-out infinite;
}

#login-section::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(15, 23, 42, 0.15);
    border-radius: 50%;
    bottom: -150px;
    right: -150px;
    filter: blur(50px);
    animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(30px, -30px);
    }

    66% {
        transform: translate(-20px, 20px);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(-30px, 30px);
    }

    66% {
        transform: translate(20px, -20px);
    }
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.login-container {
    z-index: 2;
    position: relative;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-video {
    display: none;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    margin-top: -60px;
}

.login-card {
    background: rgba(255, 255, 255, 0.92);
    padding: 50px;
    border-radius: 25px;
    width: 380px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3), 0 0 30px rgba(37, 99, 235, 0.2);
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.8), transparent);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 30%, #10b981 60%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    animation: fadeInScale 0.8s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.login-logo i {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 30%, #10b981 60%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.login-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 35px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    gap: 8px;
}

.form-group label i {
    color: var(--primary);
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    display: none;
    position: absolute;
    left: 16px;
    color: var(--primary);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(248, 249, 250, 0.8);
    color: #1e293b;
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 0 0 1px rgba(37, 99, 235, 0.1);
    background: white;
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 5px 15px -3px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #1d4ed8 0%, #1b3aa0 100%);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.login-footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-align: center;
    z-index: 999;
    line-height: 1.6;
    max-width: 600px;
}

.login-footer p {
    margin: 0;
}

.login-footer .footer-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.login-footer .footer-description {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.login-footer .footer-copyright {
    font-size: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
}

/* --- LAYOUT --- */
#app-container {
    display: flex;
    height: 100vh;
    display: none;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: background 0.3s;
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand i {
    margin-right: 10px;
    color: var(--primary);
}

.nav-links {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    transition: transform 0.2s, filter 0.2s;
    color: var(--accent-icon);
    display: inline-block;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
}

.nav-item.active i {
    color: var(--accent-icon);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--sidebar-text);
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    overflow-y: auto;
}

.topbar {
    min-height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: var(--bg-card);
    padding: 6px 15px;
    border-radius: 30px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.user-profile:hover {
    background: var(--bg-dash);
}

.user-info-text {
    text-align: right;
    margin-right: 12px;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-display-role {
    font-size: 0.75rem;
    color: var(--text-light);
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-logout {
    margin-left: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #ef444415;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Sidebar Toggle State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .brand,
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .brand {
    font-size: 1.5rem;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .brand span,
.sidebar.collapsed .nav-links div,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-footer {
    display: none !important;
}

.theme-select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
}

.content-scroll {
    flex: 1;
    padding: 30px;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.form-control {
    margin-bottom: 5px;
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.card h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--text-main);
    font-weight: 700;
}

.card p {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th,
td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th {
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.actions-btns button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    font-size: 1rem;
    margin-right: 4px;
    transition: color 0.2s;
    color: var(--text-light);
}

.actions-btns button:hover {
    color: var(--primary);
}

.btn-delete:hover {
    color: #ef4444;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 250px;
    background: var(--bg-card);
    color: var(--text-main);
}

/* Chatbot */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: var(--bg-body);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.msg-ai {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.msg-admin {
    align-self: flex-start;
    background: #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 2px;
    border-left: 4px solid #2563eb;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex;
    gap: 10px;
}

/* Ticket History Styling */
.ticket-history {
    height: 300px;
    overflow-y: auto;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ticket-bubble {
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    max-width: 90%;
}

.tb-user {
    align-self: flex-start;
    background: var(--primary);
    color: white;
}

.tb-admin {
    align-self: flex-end;
    background: #e2e8f0;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.tb-meta {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 5px;
    display: block;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    width: 550px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.close-modal {
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.modal-wide {
    width: 900px;
}

@media (max-width: 1024px) {
    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .modal-wide {
        width: 90%;
    }
}

@media (max-width: 640px) {

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

.full-width {
    grid-column: span 2;
}

.form-control[readonly] {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-light);
    font-weight: 600;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #065f46;
    border-left: 4px solid #10b981;
}

.toast.error {
    background: #7f1d1d;
    border-left: 4px solid #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

.d-flex {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: auto;
}
