:root {
    /* Color Palette - Smart Blue Theme */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Backgrounds & Surfaces */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;

    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Spacing & Radius */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --header-height: 64px;
    --sidebar-width: 260px;
}

/* Dark Mode Support (Optional/Future) */
@media (prefers-color-scheme: dark) {
    /* :root {
        --bg-body: #0f172a;
        --bg-card: #1e293b;
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        --border-color: #334155;
    } */
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.h-screen {
    height: 100vh;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.text-sm {
    font-size: 0.875rem;
}

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

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    width: 100%;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Login Page Specific */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.alert {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

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

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .sidebar-header i {
    margin: 0;
}

/* Hide text in collapsed mode */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .sidebar-header i+span,
/* Hide "OLT Manager" text */
.sidebar.collapsed .sidebar-header i,
/* Hide icon if needed, but let's keep it */
.sidebar.collapsed .sidebar-footer .nav-item span:not(.nav-icon) {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    font-size: 0;
    /* Hide text nodes */
}

.sidebar.collapsed .sidebar-header i {
    display: block;
    /* Keep icon visible */
    font-size: 1.25rem;
    margin: 0;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

/* Desktop Toggle Button */
.desktop-menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.desktop-menu-toggle:hover {
    background-color: var(--bg-body);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.nav-icon {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-bar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.content-wrapper {
    padding: 2rem;
    flex: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-desc {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* Table Styles */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    /* Changed from overflow: hidden; */
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

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

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

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

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

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

.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    background-color: #d1fae5;
    color: #065f46;
}

.badge-neutral {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Status row highlighting */
.bg-gray {
    background-color: #e5e7eb !important;
}

.bg-warning {
    background-color: #fef3c7 !important;
}

.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online {
    background-color: #dcfce7;
    color: #166534;
}

.status-offline {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ===========================
   Mobile Responsive Styles
   =========================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

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

/* Tablet Styles (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --sidebar-width: 220px;
    }

    .sidebar-header {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .sidebar-nav {
        padding: 1rem 0.75rem;
    }

    .nav-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Styles (< 768px) */
@media (max-width: 767px) {

    /* Show Mobile Menu Button */
    .mobile-menu-toggle {
        display: block;
    }

    .desktop-menu-toggle {
        display: none;
    }

    /* Hide Sidebar by Default */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    /* Main Content Full Width */
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    /* Top Bar Adjustments */
    .top-bar {
        padding: 0 1rem;
    }

    .top-bar h2 {
        font-size: 1.25rem;
    }

    .user-info {
        font-size: 0.85rem;
    }

    .user-info span.text-muted {
        display: none;
    }

    /* Content Wrapper */
    .content-wrapper {
        padding: 1rem;
    }

    /* Stats Grid - Single Column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
    }

    /* Tables - Horizontal Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 800px;
    }

    th,
    td {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    /* Forms */
    .form-group {
        width: 100% !important;
    }

    .flex.gap-4.items-end {
        flex-direction: column;
        align-items: stretch !important;
    }

    .flex.gap-4.items-end>* {
        width: 100% !important;
    }

    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }

    .sync-btn-group {
        flex-direction: column;
    }

    .sync-btn-group button {
        width: 100%;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Login Page */
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .login-logo {
        font-size: 1.75rem;
    }

    /* Modal */
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-height: 85vh;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        white-space: nowrap;
    }
}

/* Small Mobile Styles (< 480px) */
@media (max-width: 479px) {
    .top-bar h2 {
        font-size: 1.1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-title,
    .stat-desc {
        font-size: 0.75rem;
    }

    /* Super compact table for very small screens */
    th,
    td {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .form-control {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Sidebar Width */
    .sidebar {
        width: 85%;
        max-width: 280px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }

    .sidebar-nav {
        padding: 0.75rem;
    }

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

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn,
    .nav-item,
    .page-link {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-item:hover {
        transform: none;
    }

    /* Better tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
}
/* ===========================
   Dashboard Widget System
   =========================== */

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.dashboard-toolbar-left h2 {
    margin: 0;
    font-size: 1.5rem;
}

.dashboard-toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.dashboard-toolbar-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Widget Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Widget Container */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.widget:hover {
    box-shadow: var(--shadow-lg);
}

/* Widget Sizes */
.widget-small {
    grid-column: span 1;
}

.widget-medium {
    grid-column: span 2;
}

.widget-large {
    grid-column: span 3;
}

@media (max-width: 1400px) {
    .widget-large {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .widget-small,
    .widget-medium,
    .widget-large {
        grid-column: span 1;
    }
}

/* Widget Header */
.widget-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #fff, #fafafa);
}

.widget-drag-handle {
    cursor: grab;
    padding: 0.25rem;
    margin-right: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.widget-drag-handle:hover {
    color: var(--primary);
}

.widget-drag-handle:active {
    cursor: grabbing;
}

.widget-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.widget-refresh,
.widget-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.widget-refresh:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.widget-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Widget Content */
.widget-content {
    padding: 1.25rem;
    flex: 1;
    min-height: 120px;
}

.widget-loading,
.widget-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-muted);
}

.widget-loading i,
.widget-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.widget-error {
    color: var(--danger);
}

/* Sortable States */
.widget-ghost {
    opacity: 0.4;
    background: var(--bg-body);
}

.widget-chosen {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.widget-drag {
    opacity: 0.8;
    transform: rotate(2deg);
}

/* Widget Specific Styles */
.widget-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.widget-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
}

.widget-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.widget-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Add Widget Modal */
.add-widget-dropdown {
    position: relative;
    display: inline-block;
}

.add-widget-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    z-index: 100;
    display: none;
}

.add-widget-menu.active {
    display: block;
}

.add-widget-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.add-widget-item:hover {
    background: var(--bg-body);
}

.add-widget-item i {
    margin-right: 0.75rem;
    color: var(--primary);
}

.add-widget-item-info {
    flex: 1;
}

.add-widget-item-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.add-widget-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animation for adding/removing widgets */
@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.widget {
    animation: widgetFadeIn 0.3s ease;
}

/* ===========================
   Dashboard Widget System
   =========================== */

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.dashboard-toolbar-left h2 {
    margin: 0;
    font-size: 1.5rem;
}

.dashboard-toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.dashboard-toolbar-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Widget Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Widget Container */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.widget:hover {
    box-shadow: var(--shadow-lg);
}

/* Widget Sizes */
.widget-small {
    grid-column: span 1;
}

.widget-medium {
    grid-column: span 2;
}

.widget-large {
    grid-column: span 3;
}

@media (max-width: 1400px) {
    .widget-large {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .widget-small,
    .widget-medium,
    .widget-large {
        grid-column: span 1;
    }
}

/* Widget Header */
.widget-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #fff, #fafafa);
}

.widget-drag-handle {
    cursor: grab;
    padding: 0.25rem;
    margin-right: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.widget-drag-handle:hover {
    color: var(--primary);
}

.widget-drag-handle:active {
    cursor: grabbing;
}

.widget-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.widget-refresh,
.widget-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.widget-refresh:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.widget-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Widget Content */
.widget-content {
    padding: 1.25rem;
    flex: 1;
    min-height: 120px;
}

.widget-loading,
.widget-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-muted);
}

.widget-loading i,
.widget-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.widget-error {
    color: var(--danger);
}

/* Sortable States */
.widget-ghost {
    opacity: 0.4;
    background: var(--bg-body);
}

.widget-chosen {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.widget-drag {
    opacity: 0.8;
    transform: rotate(2deg);
}

/* Widget Specific Styles */
.widget-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.widget-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
}

.widget-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.widget-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Add Widget Modal */
.add-widget-dropdown {
    position: relative;
    display: inline-block;
}

.add-widget-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    z-index: 100;
    display: none;
}

.add-widget-menu.active {
    display: block;
}

.add-widget-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.add-widget-item:hover {
    background: var(--bg-body);
}

.add-widget-item i {
    margin-right: 0.75rem;
    color: var(--primary);
}

.add-widget-item-info {
    flex: 1;
}

.add-widget-item-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.add-widget-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animation for adding/removing widgets */
@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.widget {
    animation: widgetFadeIn 0.3s ease;
}
