:root {
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --primary: #38BDF8;
    --primary-hover: #0EA5E9;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --sidebar-width: 260px;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fade { animation: fadeIn 0.5s ease forwards; }
.animate-slide { animation: slideIn 0.5s ease forwards; }

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-width: 0;
}

/* Sidebar Elements */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 3rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.nav-link i {
    font-size: 1.25rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

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

.label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input {
    width: 100%;
    background: #0F172A;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    outline: none;
    transition: border-color 0.3s ease;
    color-scheme: dark;
}

.input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.input:focus {
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #0F172A;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

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

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

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.1); color: #4ADE80; }
.badge-warning { background: rgba(234, 179, 8, 0.1); color: #FACC15; }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #F87171; }

/* Searchable Select */
.searchable-select {
    position: relative;
    width: 100%;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.search-results.active {
    display: block;
}

.search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
}

.search-item:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.search-item.no-results {
    color: var(--text-muted);
    cursor: default;
}

/* Email Tags */
.email-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 44px;
    align-items: center;
    padding: 0.5rem;
}

.email-tag {
    background: var(--primary);
    color: #0F172A;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.email-tag i {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.email-tag i:hover {
    opacity: 1;
}
