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

:root {
    --bg-main: #f4f7fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --primary-blue: #3b82f6;
    --primary-hover: #2563eb;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
    --border-color: #eef2f6;
    --sidebar-width: 250px;
    --header-height: 70px;
    
    /* Status Colors */
    --status-success: #10b981;
    --status-danger: #ef4444;
    --status-warning: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden !important;
}

.layout-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    padding: 1.5rem 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f43f5e, #fb923c);
    border-radius: 8px;
    transform: rotate(45deg);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1e293b;
}

.nav-section {
    flex: 1;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-blue);
    background-color: #f8fafc;
}

.nav-link.active {
    color: var(--primary-blue);
    background-color: #f0f7ff;
    border-left-color: var(--primary-blue);
}

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

.badge {
    margin-left: auto;
    background: #f43f5e;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* --- Top Bar --- */
.topbar {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    width: 300px;
}

.search-input-group input {
    background: transparent;
    border: none;
    outline: none;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
}

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

.action-icon {
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #f43f5e;
    border: 2px solid #fff;
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.page-container {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    outline: none; /* Removes the focus ring from the h1 on navigation */
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Custom Data List (The Arion Style Table) --- */
.data-list-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    overflow: visible; /* Required for dropdowns */
}

.dropdown-menu {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    z-index: 1100;
}

.filter-bar {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    background: #fff;
}

.add-btn-circle {
    width: 44px;
    height: 44px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn-circle:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Row Styling */
.list-header {
    display: grid;
    grid-template-columns: 50px 80px 2fr 1fr 1fr 1fr 150px 50px;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.list-row {
    display: grid;
    grid-template-columns: 50px 80px 2fr 1fr 1fr 1fr 150px 50px;
    padding: 1.25rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
}

.list-row:hover {
    background-color: #f9fafb;
}

.list-row:last-child {
    border-bottom: none;
}

.item-id {
    color: var(--text-muted);
    font-family: monospace;
}

.item-name {
    font-weight: 600;
    color: var(--text-dark);
}

.status-dot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-success { background-color: var(--status-success); }
.dot-danger { background-color: var(--status-danger); }
.dot-warning { background-color: var(--status-warning); }

.pagination-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-btns {
    display: flex;
    gap: 0.25rem;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.page-btn.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* Utilities */
.cursor-pointer { cursor: pointer; }
.transition-200 { transition: all 0.2s ease; }

.btn-link {
    text-decoration: none !important;
}

i[class^="ri-"], i[class*=" ri-"] {
    text-decoration: none !important;
    display: inline-block;
}

/* Radzen Overrides */
.rz-datagrid {
    border: none !important;
    background: transparent !important;
}

.rz-datagrid-header {
    background: #f8f9fa !important;
    border-bottom: 1px solid #eee !important;
    padding: 1rem !important;
}

.rz-column-title {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #6c757d !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.rz-datagrid-data td {
    padding: 1rem !important;
    border-bottom: 1px solid #f1f1f1 !important;
    vertical-align: middle !important;
    overflow: visible !important;
}

.rz-cell-data {
    overflow: visible !important;
    white-space: normal !important;
}

.rz-datagrid-row:hover {
    background-color: #f8f9ff !important;
    cursor: pointer;
}

/* Ensure dropdowns aren't clipped by grid cells or wrappers */
.rz-datagrid,
.rz-datagrid-scrollable-wrapper,
.rz-datagrid-scrollable-view,
.rz-datagrid-body,
.rz-data-grid-data,
.rz-cell-data {
    overflow: visible !important;
}

.rz-paginator {
    background: transparent !important;
    border: none !important;
    padding: 1rem !important;
}

.rz-paginator-summary {
    font-size: 0.85rem !important;
    color: #6c757d !important;
}

/* Dashboard Specifics */
.fs-4 { font-size: 1.5rem !important; }
.fw-bold { font-weight: 700 !important; }
.rounded-3 { border-radius: 0.75rem !important; }

/* --- Drawer Styles --- */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.drawer-container {
    position: fixed;
    background: #fff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1);
}

/* Web: Slide from Right */
@media (min-width: 768px) {
    .drawer-container {
        top: 0;
        right: 0;
        width: 450px;
        height: 100vh;
        transform: translateX(100%);
    }
    /* When shown, slide left by the offset amount */
    .drawer-container.show {
        transform: translateX(calc(-1 * var(--drawer-offset, 0px)));
    }
}

/* Mobile: Slide from Bottom */
@media (max-width: 767px) {
    .drawer-container {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 80vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    .drawer-container.show {
        transform: translateY(0);
    }

    .drawer-container.full-height {
        height: 100vh !important;
        border-radius: 0 !important;
    }

    .drawer-handle {
        width: 100%;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: grab;
        padding-top: 10px;
    }

    .drawer-handle::after {
        content: "";
        width: 40px;
        height: 4px;
        background: #e2e8f0;
        border-radius: 2px;
    }
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Responsive System --- */

/* Utility Visibility Classes */
.desktop-only { display: block !important; }
.mobile-only { display: none !important; }

@media (max-width: 1199.98px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    .layout-wrapper { display: block !important; }
    
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
        background: white;
        box-shadow: 10px 0 25px rgba(0,0,0,0.1);
    }
    .sidebar.show { transform: translateX(0); }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        overflow-x: hidden;
    }
    
    .topbar { padding: 0 1rem; width: 100%; }
    .search-input-group { display: none; }
    .page-container { padding: 1rem; width: 100%; }
}

/* Card Grid System */
.mobile-card-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

@media (min-width: 768px) {
    .mobile-card-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Card Visual Styles */
.mobile-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    min-width: 0;
    height: 100%;
}

.mobile-card:active { transform: scale(0.98); }

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-light, .btn-icon-danger {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; outline: none;
}

.btn-icon-light { background: #f8fafc; border: 1px solid #eef2f6; color: #64748b; }
.btn-icon-danger { background: #fef2f2; border: 1px solid #fee2e2; color: #ef4444; }

/* Small Phone Adjustments */
@media (max-width: 575.98px) {
    .topbar-actions .user-name { display: none; }
    .drawer-container { width: 100% !important; }
}
/* --- Contact Group --- */
.contact-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.contact-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contact-group .country-select {
    border: none !important;
    background: #f8fafc !important;
    border-right: 1px solid var(--border-color) !important;
    width: 120px !important;
    border-radius: 0 !important;
    height: 100% !important;
}

.contact-group .phone-input {
    border: none !important;
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    outline: none !important;
    box-shadow: none !important;
}

.contact-group .country-select:focus,
.contact-group .phone-input:focus {
    box-shadow: none !important;
}
