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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #ec4899;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --sidebar-width: 280px;
    --navbar-height: 80px;
    --card-bg: #ffffff;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f8fafc;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, #e0e7ff 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, #fce7f3 0%, transparent 40%);
    z-index: -1;
}

/* Layout Structure */
.main-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--navbar-height) 1fr;
    grid-template-areas: 
        "sidebar navbar"
        "sidebar content";
    min-height: 100vh;
}

.sidebar {
    grid-area: sidebar;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.navbar {
    grid-area: navbar;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.content-area {
    grid-area: content;
    padding: 2rem;
    max-width: 1400px;
}

.sidebar-logo {
    margin-bottom: 3rem;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: var(--gray);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    gap: 1rem;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: 16px;
    margin-top: auto;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Login Page specifically */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 450px;
}

/* PDF Preview Tool */
#pdf-preview-container {
    position: relative;
    border: 2px dashed var(--gray);
    border-radius: 16px;
    margin-bottom: 2rem;
    background: #fff;
    overflow: auto;
    max-height: 70vh;
}

#pdf-canvas {
    display: block;
    margin: 0 auto;
}

.marker {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid var(--primary);
    background: rgba(99, 102, 241, 0.2);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--primary-dark);
    pointer-events: none;
}

.marker.serial {
    border-color: var(--secondary);
    background: rgba(236, 72, 153, 0.2);
    color: var(--secondary);
}

/* Dashboard Styles */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 20px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #f1f5f9;
    color: var(--gray);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

tr:hover td {
    background-color: rgba(99, 102, 241, 0.02);
}
