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

:root {
    /* --- V4 PRO PALETTE (NEON GLASS) --- */
    --primary: #7367F0;
    --primary-rgb: 115, 103, 240;
    --primary-hover: #5e50ee;
    --primary-glow: 0 0 20px rgba(115, 103, 240, 0.4);

    --secondary: #a8aaae;
    --success: #28c76f;
    --success-glow: 0 0 15px rgba(40, 199, 111, 0.4);

    --danger: #ea5455;
    --warning: #ff9f43;
    --info: #00cfe8;

    /* Glass Backgrounds */
    --bg-body: #F4F5FA;
    /* Slightly cooler grey/blue tint */
    --glass-surface: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-blur: blur(14px);

    /* Text */
    --text-main: #33303c;
    /* Darker, sharper */
    --text-muted: #82868b;
    --text-light: #ffffff;

    /* Neo Shadows */
    --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --shadow-hover: 0 12px 40px 0 rgba(115, 103, 240, 0.15);
    /* Tinted hover shadow */
    --shadow-neon: 0 0 15px rgba(115, 103, 240, 0.3);

    /* Spacing & Radius */
    --radius: 12px;
    /* Softer, more modern curves */

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Snappy smooth */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Public Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;

    /* AURORA BACKGROUND */
    background-color: #f4f5fa;
    background-image:
        radial-gradient(at 10% 10%, rgba(115, 103, 240, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(0, 207, 232, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(234, 84, 85, 0.1) 0px, transparent 50%),
        radial-gradient(at 10% 90%, rgba(115, 103, 240, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: 150% 150%;
    animation: aurora 20s ease infinite alternate;
}

@keyframes aurora {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* --- GLASS UTILITIES --- */
.card,
.vuexy-card,
.glass-panel {
    background: var(--glass-surface) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-card) !important;
    transition: var(--transition);
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    /* Fade In Up Entrance */
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.card:hover,
.vuexy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover) !important;
    border-color: rgba(115, 103, 240, 0.3) !important;
}

.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Inherits aurora body bg */
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #4b4b66;
    /* Softer dark */
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.5px;
    /* Modern tight spacing */
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInDown 0.5s ease backwards;
}

.page-title {
    font-size: 1.7rem;
    /* Larger */
    font-weight: 600;
    color: var(--text-main);
    border-left: none;
    /* Removed old style */
    padding-left: 0;
    position: relative;
    /* Gradient Text effect optional but staying clean is better */
}

/* Underline accent */
.page-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: 2px;
    margin-top: 5px;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.5);
    /* Semi-transparent input */
    border: 1px solid #d8d6de;
    border-radius: 8px;
    /* Slightly rounder */
    color: var(--text-main);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
    /* Soft ring */
    outline: none;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    gap: 8px;
    font-family: var(--font-heading);
    position: relative;
    overflow: hidden;
}

/* Ripple effect basic replacement with active scale */
.btn:active {
    transform: scale(0.96) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 15px rgba(115, 103, 240, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(115, 103, 240, 0.6);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(234, 84, 85, 0.1);
    color: var(--danger);
    box-shadow: none;
}

.btn-danger:hover {
    background: rgba(234, 84, 85, 0.2);
    color: #ff3333;
    transform: translateY(-2px);
}

/* --- LAYOUT --- */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* Body bg determines look */
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* GLASS SIDEBAR */
.sidebar {
    width: 270px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Safari */
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center logo area */
    /* padding: 0 1.5rem; */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
    letter-spacing: -1px;
    position: relative;
}

/* decorative glow under header */
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(115, 103, 240, 0.3), transparent);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    /* More breathing room */
    color: #6e6b7b;
    text-decoration: none;
    font-weight: 500;
    margin: 4px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 14px;
    font-size: 1rem;
    font-family: var(--font-heading);
}

.nav-link:hover {
    padding-left: 28px;
    background-color: rgba(255, 255, 255, 0.6);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.nav-link.active {
    background: linear-gradient(118deg, var(--primary), rgba(115, 103, 240, 0.9));
    box-shadow: 0 5px 15px rgba(115, 103, 240, 0.4);
    color: #fff !important;
}

/* --- TOPBAR --- */
.topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    margin: 1.5rem 2rem 0 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    /* Softer shadow */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 10;
    animation: fadeInDown 0.6s ease backwards;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    font-size: 1.4rem;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-text {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    color: #5e5873;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.75rem;
    color: #b9b9c3;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid #fff;
}

/* --- MAIN CONTENT --- */
.main-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- STAT CARDS --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    /* Larger gap */
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Clean overrides handled by global .card class now, but specific styles: */
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

/* Icon box inside stat card */
.stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    /* This class needs to be added in JS or assumed default style if not present */
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -1px;
}

/* --- TABLES --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    /* Increased row spacing */
}

thead th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 1.5rem;
    font-weight: 700;
    border: none !important;
    font-family: var(--font-heading);
}

/* Make rows look like flying glass cards */
tbody tr {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

tbody tr:hover {
    transform: translateY(-4px) scale(1.005);
    background-color: #fff;
    box-shadow: 0 15px 30px rgba(115, 103, 240, 0.15);
    /* Purple tint glow */
    z-index: 10;
    position: relative;
}

tbody td {
    padding: 1.2rem 1.5rem;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}

tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* --- IMAGES & ZOOM --- */
.zoom-img {
    transition: all 0.3s ease;
    border: 1px solid #ebe9f1;
}

.zoom-img:hover {
    transform: scale(1.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border-color: var(--primary);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d0d2d6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b9b9c3;
}

/* --- IONICONS FIX --- */
ion-icon {
    vertical-align: middle;
}

/* PRINT */
@media print {

    .sidebar,
    .page-header,
    .no-print {
        display: none !important;
    }

    .app-layout {
        display: block;
    }

    .main-content {
        padding: 0;
        background: white;
    }

    .glass-panel {
        box-shadow: none;
        border: 1px solid #eee;
    }
}

/* --- RESPONSIVE SIDEBAR --- */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    font-size: 1.6rem;
    margin-right: 15px;
    cursor: pointer;
    color: var(--text-main);
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100%;
        transition: all 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    /* Overlay when sidebar is open */
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        margin: 1rem;
        width: auto;
    }

    .content-wrapper {
        margin-left: 0;
    }
}

@keyframes highlightRow {
    0% {
        background-color: rgba(115, 103, 240, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

/* --- VUEXY REDESIGN --- */

.vuexy-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    padding: 0;
    /* Table fills the card */
    overflow: hidden;
    margin-bottom: 2rem;
}

.vuexy-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ebe9f1;
}

.vuexy-table {
    width: 100%;
    border-collapse: collapse;
    /* Standard table look */
    border-spacing: 0;
}

.vuexy-table thead th {
    background-color: #f8f8f8;
    color: var(--text-main);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ebe9f1;
    font-weight: 600;
}

.vuexy-table tbody tr {
    border-bottom: 1px solid #ebe9f1;
    transition: all 0.2s ease;
    box-shadow: none;
    /* Reset card-row style */
}

.vuexy-table tbody tr:hover {
    background-color: #f3f2f7 !important;
    /* Vuexy hover */
    transform: none;
    box-shadow: none;
    z-index: auto;
}

.vuexy-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: var(--text-main);
    font-size: 0.95rem;
    border: none;
}

/* Product Cell */
.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-thumb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    /* OR square with radius? Vuexy often uses rounded squares for products */
    border-radius: 6px;
    background-color: #f3f2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.product-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.product-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    /* Rounded pill */
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.badge-light-primary {
    background: rgba(115, 103, 240, 0.12);
    color: var(--primary);
}

.badge-light-success {
    background: rgba(40, 199, 111, 0.12);
    color: var(--success);
}

.badge-light-warning {
    background: rgba(255, 159, 67, 0.12);
    color: var(--warning);
}

.badge-light-info {
    background: rgba(0, 207, 232, 0.12);
    color: var(--info);
}

/* Actions */
.action-btn {
    color: var(--text-muted);
    transition: 0.2s;
    cursor: pointer;
    font-size: 1.1rem;
    margin: 0 5px;
}

.action-btn:hover {
    color: var(--primary);
}

.delete-btn:hover {
    color: var(--danger);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--primary);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider:hover {
    box-shadow: 0 0 8px rgba(115, 103, 240, 0.3);
}

/* Modal Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.rotate {
    animation: rotation 2s infinite linear;
    display: inline-block;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(359deg);
    }
}

/* --- NEW ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- LOGIN WOW PAGE --- */
.login-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Aurora bg is already body default, but we can enhance */
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Massive blur for nebula effect */
    z-index: 0;
    opacity: 0.6;
    animation: floatShape 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--info);
    bottom: -5%;
    left: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--danger);
    bottom: 20%;
    right: 20%;
    animation-delay: -2s;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    /* Super transparent */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 5;
    /* Above shapes */
    animation: zoomIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-logo {
    margin-bottom: 40px;
}

.login-logo img {
    height: 220px;
    filter: drop-shadow(0 0 15px rgba(115, 103, 240, 0.4));
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}