/* ============================
   AI Agent SaaS - Common Styles
   Dark Theme — Premium Design
   ============================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #161637;
    --bg-sidebar: #0d0d24;
    --bg-input: #1a1a3e;
    --bg-hover: #1e1e45;

    --text-primary: #e8e8f0;
    --text-secondary: #9d9db8;
    --text-muted: #6b6b8a;

    --accent-gold: #f5a623;
    --accent-green: #00d26a;
    --accent-red: #ff4757;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(245, 166, 35, 0.15);

    --glass-bg: rgba(22, 22, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);

    --sidebar-width: 260px;
    --header-height: 65px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(245, 166, 35, 0.1);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #ffc048;
}

/* ========== LAYOUT ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: var(--transition);
}

.page-content {
    padding: 24px;
    max-width: 1400px;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-gold), #ff8c00);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #0a0a1a;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

.sidebar-brand .brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-menu {
    padding: 12px 0;
    flex: 1;
}

.sidebar-section {
    padding: 8px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: rgba(245, 166, 35, 0.3);
}

.sidebar-link.active {
    color: var(--accent-gold);
    background: rgba(245, 166, 35, 0.08);
    border-left-color: var(--accent-gold);
    font-weight: 600;
}

.sidebar-link .icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-link .badge {
    margin-left: auto;
    background: var(--accent-gold);
    color: #0a0a1a;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.sidebar-link .badge.upcoming {
    background: var(--text-muted);
    color: var(--bg-primary);
}

/* Sidebar submenu */
.sidebar-submenu {
    display: none;
    padding-left: 32px;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-submenu .sidebar-link {
    padding: 8px 20px;
    font-size: 13px;
    border-left: 2px solid transparent;
}

.sidebar-parent {
    cursor: pointer;
}

.sidebar-parent .arrow {
    margin-left: auto;
    font-size: 11px;
    transition: var(--transition);
}

.sidebar-parent.open .arrow {
    transform: rotate(90deg);
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.header-user:hover {
    border-color: var(--accent-gold);
}

.header-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.header-user .user-name {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(245, 166, 35, 0.15);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ========== TABLE ========== */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-wrap .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-wrap .table-header h3 {
    font-size: 15px;
    font-weight: 700;
}

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

table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

table td {
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #e09500);
    color: #0a0a1a;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(245, 166, 35, 0.35);
    color: #0a0a1a;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #00b85c);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #e0343f);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239d9db8' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ========== STATUS BADGES ========== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.status-active, .status-approved {
    background: rgba(0, 210, 106, 0.12);
    color: var(--accent-green);
}

.status-pending {
    background: rgba(245, 166, 35, 0.12);
    color: var(--accent-gold);
}

.status-suspended, .status-rejected, .status-expired {
    background: rgba(255, 71, 87, 0.12);
    color: var(--accent-red);
}

/* ========== ALERTS ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid rgba(0, 210, 106, 0.2);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
}

/* ========== PAGINATION ========== */
.pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 16px;
    gap: 4px;
}

.pagination-wrap .page-link {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.pagination-wrap .page-link:hover,
.pagination-wrap .page-link.active {
    background: var(--accent-gold);
    color: #0a0a1a;
    border-color: var(--accent-gold);
}

/* ========== PROGRESS BAR ========== */
.progress {
    height: 8px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
    transition: width 0.6s ease;
}

/* ========== TOGGLE SWITCH ========== */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

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

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border-radius: 24px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

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

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

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== USER DROPDOWN ========== */
.header-right {
    position: relative;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown .dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== PAGE TITLE (Content Area) ========== */
.page-title-bar {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* ========== TABLE RESPONSIVE ========== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header {
        left: 0;
        padding: 0 12px;
    }

    .header-left .page-title {
        display: none;
    }

    .sidebar-toggle {
        display: block;
    }

    .page-content {
        padding: 12px;
        overflow-x: hidden;
        max-width: 100vw;
        word-break: break-word;
    }

    .page-title-bar {
        font-size: 16px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    /* Stats Grid — 2 column on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-value {
        font-size: 18px;
    }

    .stat-card .stat-label {
        font-size: 10.5px;
    }

    .stat-card .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
        margin-bottom: 10px;
    }

    /* Tables — horizontally scrollable wrapper */
    .table-wrap {
        border-radius: var(--radius-md);
    }

    .table-wrap .table-header {
        padding: 12px 14px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .table-wrap .table-header h3 {
        font-size: 14px;
    }

    table {
        font-size: 12px;
        min-width: 700px;
    }

    table th, table td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Cards */
    .card {
        padding: 14px;
        border-radius: var(--radius-md);
        word-break: break-word;
    }

    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Header user */
    .header-user .user-name {
        display: none;
    }

    .user-dropdown {
        right: -8px;
    }

    /* Forms */
    .form-control {
        font-size: 14px;
        padding: 10px 12px;
    }

    .form-label {
        font-size: 12.5px;
    }

    /* Alerts */
    .alert {
        font-size: 12px;
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .alert .btn {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 4px;
    }

    /* Modal */
    .modal-box {
        padding: 16px;
        width: 95%;
        max-height: 90vh;
        border-radius: var(--radius-md);
    }

    /* Progress bar */
    .progress {
        height: 6px;
    }

    /* Tab navigation */
    .tab-nav {
        padding: 2px;
        gap: 1px;
    }

    .tab-nav a {
        padding: 7px 12px;
        font-size: 12px;
    }

    /* Search bar */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar form {
        flex-direction: column !important;
    }

    .search-bar .form-control {
        max-width: 100% !important;
    }

    /* Product cards grid */
    .stats-grid[style*="minmax(260px"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Orders page - inline stats */
    div[style*="display:flex"][style*="gap:12px"][style*="margin-bottom:20px"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Order card actions */
    div[style*="display:flex"][style*="gap:6px"][style*="flex-wrap:wrap"] {
        width: 100%;
    }

    /* Products/orders toolbar */
    div[style*="display:flex"][style*="justify-content:space-between"][style*="margin-bottom:20px"] {
        flex-direction: column;
        gap: 10px;
    }

    /* Provider cards (AI models) */
    .provider-card .provider-header {
        padding: 12px 14px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .provider-card .provider-body {
        padding: 14px;
    }

    .provider-card .model-tag {
        font-size: 11.5px;
        padding: 5px 10px;
    }

    /* Package cards grid */
    .stats-grid[style*="minmax(280px"] {
        grid-template-columns: 1fr !important;
    }

    /* Connection status */
    .connection-status {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Pagination */
    .pagination-wrap {
        padding: 12px 8px;
        flex-wrap: wrap;
    }

    .pagination-wrap .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Copy button */
    .copy-btn {
        font-size: 10px;
        padding: 3px 8px;
    }

    /* Status badges */
    .status {
        font-size: 10.5px;
        padding: 3px 8px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .page-content {
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-card .stat-value {
        font-size: 16px;
    }

    .stat-card .stat-label {
        font-size: 10px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    /* Product cards go single column on very small screens */
    .stats-grid[style*="minmax(260px"] {
        grid-template-columns: 1fr !important;
    }

    .header {
        padding: 0 8px;
    }

    .header-right {
        gap: 8px;
    }

    .status.status-expired[style*="font-size:11px"] {
        font-size: 9px !important;
        padding: 3px 6px;
    }

    .page-title-bar {
        font-size: 14px;
    }

    /* Modal adjustments */
    .modal-box {
        padding: 14px;
        width: 98%;
    }

    .modal-box table td {
        font-size: 12px;
        padding: 6px 0;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== GRID ========== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ========== TAB NAV ========== */
.tab-nav {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-nav a {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: var(--transition);
}

.tab-nav a:hover {
    color: var(--text-primary);
}

.tab-nav a.active {
    background: var(--accent-gold);
    color: #0a0a1a;
}

/* ========== SEARCH BAR ========== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar .form-control {
    max-width: 320px;
}

/* ========== PROVIDER CARD (AI Models) ========== */
.provider-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.provider-card .provider-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.provider-card .provider-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.provider-card .provider-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-card .provider-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.provider-card .provider-body {
    padding: 20px;
}

.provider-card .model-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 4px;
    transition: var(--transition);
}

.provider-card .model-tag.active {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.provider-card .model-tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.provider-card .model-tag.active .dot {
    background: var(--accent-green);
}

/* ========== COPY BUTTON ========== */
.copy-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ========== CONNECTION STATUS ========== */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.connection-status.connected {
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid rgba(0, 210, 106, 0.2);
    color: var(--accent-green);
}

.connection-status.disconnected {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
}

.connection-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.connection-status.connected .dot {
    background: var(--accent-green);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
