@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════
   CSS VARIABLES / DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
    --bg-primary: #0c0d10;
    --bg-secondary: #13141a;
    --bg-card: #1a1b23;
    --bg-card-hover: #1f2029;
    --bg-elevated: #222330;
    --bg-input: #16171e;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(88, 101, 242, 0.5);

    --text-primary: #e4e5ea;
    --text-secondary: #9b9da4;
    --text-muted: #6d6f78;
    --text-heading: #ffffff;

    --accent-primary: #5865F2;
    --accent-primary-hover: #4752c4;
    --accent-green: #43b581;
    --accent-green-glow: rgba(67, 181, 129, 0.25);
    --accent-red: #ed4245;
    --accent-red-glow: rgba(237, 66, 69, 0.25);
    --accent-yellow: #faa61a;
    --accent-yellow-glow: rgba(250, 166, 26, 0.25);
    --accent-cyan: #00d4aa;
    --accent-purple: #9b59b6;

    --gradient-brand: linear-gradient(135deg, #5865F2 0%, #7289da 50%, #99aab5 100%);
    --gradient-success: linear-gradient(135deg, #43b581, #2ecc71);
    --gradient-danger: linear-gradient(135deg, #ed4245, #c0392b);
    --gradient-warning: linear-gradient(135deg, #faa61a, #e67e22);
    --gradient-info: linear-gradient(135deg, #00d4aa, #3498db);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(88, 101, 242, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --header-height: 70px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(88, 101, 242, 0.12) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(67, 181, 129, 0.08) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-container {
    background: var(--bg-card);
    padding: 50px 40px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 1;
    animation: fadeSlideUp 0.6s ease;
}

.login-container h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.login-container p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-container .bot-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.3);
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-primary);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

.login-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.login-btn svg {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT: SIDEBAR + MAIN
   ═══════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(88, 101, 242, 0.12);
    color: var(--accent-primary);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
    font-size: 20px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-link .nav-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    flex-shrink: 0;
}

.sidebar-user .user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-user .logout-icon {
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-fast);
    cursor: pointer;
}

.sidebar-user .logout-icon:hover {
    color: var(--accent-red);
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Page Header */
.page-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}

.page-header .header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Page body */
.page-body {
    padding: 28px 32px;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .card-icon {
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.card-full {
    grid-column: 1 / -1;
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.stat-blue::before {
    background: var(--gradient-brand);
}

.stat-card.stat-green::before {
    background: var(--gradient-success);
}

.stat-card.stat-red::before {
    background: var(--gradient-danger);
}

.stat-card.stat-yellow::before {
    background: var(--gradient-warning);
}

.stat-card.stat-cyan::before {
    background: var(--gradient-info);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: inline-flex;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   STATUS INDICATORS
   ═══════════════════════════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-online {
    background: rgba(67, 181, 129, 0.12);
    color: var(--accent-green);
}

.status-offline {
    background: rgba(237, 66, 69, 0.12);
    color: var(--accent-red);
}

.status-warning {
    background: rgba(250, 166, 26, 0.12);
    color: var(--accent-yellow);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green-glow);
    animation: pulse-dot 2s infinite;
}

.status-dot.offline {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red-glow);
}

.status-dot.warning {
    background: var(--accent-yellow);
    box-shadow: 0 0 8px var(--accent-yellow-glow);
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 181, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #3ca374;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 2px 8px rgba(237, 66, 69, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #c73a3d;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--accent-yellow);
    color: #1a1b23;
    box-shadow: 0 2px 8px rgba(250, 166, 26, 0.3);
}

.btn-warning:hover:not(:disabled) {
    background: #e09517;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 15px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   LOG VIEWER
   ═══════════════════════════════════════════════════════════ */
.log-viewer {
    background: #0a0b0e;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #c8d3da;
    height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-viewer::-webkit-scrollbar {
    width: 6px;
}

.log-viewer::-webkit-scrollbar-track {
    background: transparent;
}

.log-viewer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.log-viewer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   POPUP / MODAL
   ═══════════════════════════════════════════════════════════ */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.popup-overlay.show {
    display: flex;
}

.popup-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 36px;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.popup-icon {
    font-size: 52px;
    margin-bottom: 16px;
}

.popup-message {
    white-space: pre-line;
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    font-size: 13px;
}

.toast.toast-success {
    border-left: 4px solid var(--accent-green);
}

.toast.toast-error {
    border-left: 4px solid var(--accent-red);
}

.toast.toast-warning {
    border-left: 4px solid var(--accent-yellow);
}

.toast.toast-info {
    border-left: 4px solid var(--accent-primary);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
    color: var(--text-primary);
}

.toast-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   SERVER LIST
   ═══════════════════════════════════════════════════════════ */
.server-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.server-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.server-info {
    flex: 1;
    min-width: 0;
}

.server-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.server-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tag-owner {
    background: rgba(250, 166, 26, 0.15);
    color: var(--accent-yellow);
}

.tag-members {
    background: rgba(88, 101, 242, 0.12);
    color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════════════════
   COMMAND LOG TABLE
   ═══════════════════════════════════════════════════════════ */
.command-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.command-status.pending {
    background: rgba(250, 166, 26, 0.15);
    color: var(--accent-yellow);
}

.command-status.done {
    background: rgba(67, 181, 129, 0.15);
    color: var(--accent-green);
}

/* ═══════════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════════ */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    font-size: 20px;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 28px 0;
}

/* ═══════════════════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   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.5;
}

.empty-state p {
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   CONFIRM DIALOG
   ═══════════════════════════════════════════════════════════ */
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'Inter', sans-serif;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .card-grid-3,
    .card-grid-4 {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .page-body {
        padding: 20px 16px;
    }

    .page-header {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 24px;
    }

    .btn-group {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════ */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.gap-20 {
    gap: 20px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-24 {
    margin-bottom: 24px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 12px;
}

.text-xs {
    font-size: 11px;
}

.fw-600 {
    font-weight: 600;
}

.w-full {
    width: 100%;
}


.overflow-hidden {
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   TOGGLE SWITCH (New Power Button)
   ═══════════════════════════════════════════════════════════ */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-red);
    /* OFF state red */
    -webkit-transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--accent-green);
}

input:checked+.slider:before {
    -webkit-transform: translateX(28px);
    -ms-transform: translateX(28px);
    transform: translateX(28px);
}

.power-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.power-status-text {
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    min-width: 30px;
    font-size: 14px;
}