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

:root {
    --bg-color: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #ef4444;
    --success: #10b981;
    --sidebar-bg: #ffffff;
    --tag-bg: #e2e8f0;
    --tag-text: #334155;
    --tag-active-bg: #dbeafe;
    --tag-active-text: #1e40af;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* Login Screen */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.login-logo {
    max-width: 150px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 6px rgba(37, 99, 235, 0.2));
}

/* Form Elements */
.form-control, .form-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: #94a3b8;
}

.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Dashboard Layout */
.dashboard-container {
    display: none;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

/* Main Sidebar */
.main-sidebar {
    background: var(--sidebar-bg);
}

.sidebar-menu .nav-link {
    color: var(--text-secondary);
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-menu .nav-link:hover, .sidebar-menu .nav-link.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
}

.sidebar-menu .nav-link i {
    width: 24px;
}

/* Address Book Layout - Horizontal */
.ab-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-tag-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.01);
}

.top-tag-bar::-webkit-scrollbar {
    height: 6px;
}
.top-tag-bar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.tag-pill.active {
    background: var(--tag-active-bg);
    border-color: var(--accent);
    color: var(--tag-active-text);
}

.tag-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    background-color: #94a3b8; /* default */
}

.tag-close, .tag-edit {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
    cursor: pointer;
}

.tag-close:hover {
    color: var(--danger);
}

.tag-edit:hover {
    color: var(--accent);
}

.tag-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tag-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f8fafc;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.01);
}

.filter-input {
    flex: 1;
    min-width: 150px;
}

.ab-content {
    flex: 1;
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}


/* Tables */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.table tbody tr:hover td {
    background: #f8fafc;
}

.badge-tag {
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 0.375rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
    font-size: 0.85em;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-online { background: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.status-offline { background: #cbd5e1; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modals */
.modal-content {
    background: #ffffff;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}
