@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --brand: #0c67a5;
    --brand-dark: #095684;
    --ink: #1c1917;
    --muted: #78716c;
    --line: #e7e5e4;
    --canvas: #f6f5f2;
    --font: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Dashboard Page - Modern Layout */
body.dashboard-page {
    background: #f0f9ff;
    padding: 0;
    margin: 0;
}

/* Login Page */
body.login-page {
    background: #fff;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.auth-card {
    width: 100%;
    min-height: 100vh;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-columns: 50% 50%;
    overflow: hidden;
}

.auth-panel,
.auth-form {
    min-width: 0;
}

.auth-panel {
    background-color: #f7f9fc;
    background-image: radial-gradient(#d5deea 1.1px, transparent 1.1px);
    background-size: 16px 16px;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e6ebf2;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 12px 6px 10px;
    margin-bottom: 22px;
}

.auth-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
}

.auth-panel h1 {
    font-size: 40px;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--ink);
    font-weight: 800;
    margin-bottom: 12px;
    max-width: 560px;
}

.auth-lead {
    color: #64748b;
    font-size: 16px;
    line-height: 1.5;
    max-width: 420px;
    margin-bottom: 26px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    min-width: 0;
}

.auth-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-width: 0;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.auth-feature > div:not(.feature-icon) {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
}

.auth-feature h3 {
    font-size: 14.5px;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 2px;
}

.auth-feature p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.feature-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 18px;
    height: 18px;
}

.feature-icon.blue { background: #e8f3fa; color: #0c67a5; }
.feature-icon.violet { background: #f3e8ff; color: #7c3aed; }
.feature-icon.amber { background: #fff7ed; color: #ea580c; }
.feature-icon.green { background: #ecfdf3; color: #16a34a; }

.auth-trust {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.auth-form {
    padding: 56px 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
}

.auth-form > * {
    width: min(420px, 100%);
}

.auth-form .brand-lockup {
    margin-bottom: 28px;
}

.auth-form h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 4px;
}

.auth-form .login-subtitle {
    text-align: left;
    color: #64748b;
    margin-bottom: 28px;
    font-size: 15px;
}

.auth-form .form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.auth-form .form-group input {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.auth-form .form-group input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.req {
    color: #ef4444;
}

.password-with-generate {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-with-generate .secret-field {
    flex: 1;
}

.password-with-generate .btn {
    width: auto;
    white-space: nowrap;
    padding: 12px 14px;
}

.form-group label.otp-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.drawer .form-group input[type="checkbox"],
.form-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    accent-color: #2563eb;
    flex: 0 0 16px;
}

.auth-links {
    margin: 14px 0 0;
    text-align: center;
}

.auth-links a,
.auth-back {
    color: #2563EB;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.auth-links a:hover,
.auth-back:hover {
    text-decoration: underline;
}

.secret-field {
    position: relative;
    width: 100%;
}

.secret-field input {
    padding-right: 44px;
}

.secret-field .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    z-index: 2;
}

.auth-form .btn-primary {
    margin-top: 8px;
    border-radius: 10px;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: none;
}

.auth-form .btn-primary:hover {
    transform: none;
    box-shadow: none;
}

.auth-powered {
    margin-top: auto;
    padding-top: 28px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.auth-powered a {
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}

.brand-logo {
    height: 40px;
    width: auto;
    display: block;
}

.sidebar-header .brand-logo {
    height: 32px;
}


.brand-name {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.04em;
    color: var(--ink);
    line-height: 1;
}

.brand-name span {
    color: var(--brand);
}

/* Login Page - New Design */
.login-container {
    display: flex;
    min-height: calc(100vh - 60px);
    flex: 1;
}

/* Left Column: Maxximu Branding */
.login-left {
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 50%, #bae6fd 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 60px;
    color: #2563EB;
}

.branding-content {
    max-width: 500px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto 0;
}

.maxximu-logo {
    max-width: 250px;
    height: auto;
    filter: none;
    display: block;
}

.ngl-logo {
    max-width: 175px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.brand-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2563EB;
}

.brand-subtitle {
    font-size: 18px;
    margin-bottom: 40px;
    color: #2563EB;
    opacity: 0.9;
    line-height: 1.6;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    opacity: 0.95;
}

.feature-icon {
    font-size: 24px;
}

/* Right Column: Login Form */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: #ffffff;
}

.login-form-wrapper {
    width: 100%;
    max-width: 450px;
}

.ngl-branding {
    text-align: center;
    margin-bottom: 30px;
}

/* NGL Logo - using actual image now */
.ngl-logo-placeholder {
    display: none; /* Hidden since we're using actual logo image */
}

.ngl-text {
    display: none; /* Hidden since we're using actual logo image */
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 16px;
}

.login-form {
    margin-top: 30px;
}

/* Branding Footer (in left column) */
.branding-footer {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding-top: 20px;
    margin-top: auto;
    opacity: 0.9;
    font-size: 14px;
    color: #2563EB;
}

.branding-footer strong {
    font-weight: 600;
}

.branding-footer a {
    color: #2563EB;
    text-decoration: none;
    transition: all 0.2s;
}

.branding-footer a:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

.branding-footer .heart {
    color: #ff0000;
    display: inline-block;
    margin-left: 4px;
}

/* Old Login Card (for backward compatibility) */
.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #0ea5e9;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563EB;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #2563EB;
    color: white;
    width: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover {
    background: #1D4ED8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-outline:hover {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    background: #2563EB;
    color: white;
    border-radius: 6px;
    font-weight: 500;
}

.btn-small:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Dashboard Modern Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f4f7fb;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    border-right: 1px solid #e6ebf2;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 28px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid #eef2f6;
}

.sidebar-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    filter: none;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2563EB;
    margin: 0;
}

.sidebar-user {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563EB;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

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

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #2563EB;
    margin: 0 0 5px 0;
}

.user-role {
    font-size: 12px;
    color: #2563EB;
    opacity: 0.8;
    margin: 0;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #334155;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14.5px;
}

.menu-item:hover {
    background: #f4f7fb;
}

.menu-item.active {
    background: #eff4ff;
    color: #2563EB;
    font-weight: 700;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(37, 99, 235, 0.2);
    font-size: 12px;
    color: #2563EB;
    opacity: 0.9;
}

.sidebar-footer strong {
    font-weight: 600;
}

.sidebar-footer a {
    color: #2563EB;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-footer a:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    padding-bottom: 80px; /* Space for footer */
    min-height: 100vh;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.header-logos {
    display: flex;
    align-items: center;
    padding-right: 25px;
    border-right: 2px solid #e0f2fe;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.ngl-header-logo {
    max-height: 45px;
}

.header-title-section {
    flex: 1;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f3fa;
    color: #0c67a5;
}

.header-title-icon svg {
    width: 18px;
    height: 18px;
}

.header-title-section .subtitle-standard {
    padding-left: 48px;
}

.header-title-section.flex-column-start {
    display: grid;
    grid-template-columns: 36px max-content;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    justify-content: start;
    flex: 0 1 auto;
    width: auto;
}

.header-title-section.flex-column-start .header-title-row {
    display: contents;
}

.header-title-section.flex-column-start .header-title-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.header-title-section.flex-column-start h1 {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
}

.header-title-section.flex-column-start .subtitle-standard {
    grid-column: 2;
    grid-row: 2;
    padding-left: 0;
    margin: 0;
    text-align: left;
    justify-self: start;
}

.dashboard-header h1 {
    color: var(--ink);
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.breadcrumb-link:hover {
    background: #f0f9ff;
    border-color: #2563EB;
    color: #2563EB;
    transform: translateY(-1px);
}

.breadcrumb-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.breadcrumb-link:not(:first-child)::before {
    content: '/';
    color: #94a3b8;
    margin-right: 8px;
    font-weight: normal;
}

/* Breadcrumb Container */
.breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.view-toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    padding: 0;
}

.view-toggle-btn:hover {
    background: #e2e8f0;
    color: #2563EB;
}

.view-toggle-btn.active {
    background: #2563EB;
    color: white;
}

.view-toggle-btn.active:hover {
    background: #1D4ED8;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.breadcrumb-link:hover {
    background: #f0f9ff;
    border-color: #2563EB;
    color: #2563EB;
    transform: translateY(-1px);
}

.breadcrumb-link.active {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
    font-weight: 600;
}

.breadcrumb-link.active:hover {
    background: #1D4ED8;
    border-color: #1D4ED8;
    color: white;
    transform: translateY(-1px);
}

.breadcrumb-separator {
    color: #cbd5e1;
    font-size: 14px;
    padding: 0 4px;
    user-select: none;
}

.header-title-section .breadcrumb.mb-8 {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.breadcrumb-link-sm,
.breadcrumb-link-sm:visited {
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link-sm:hover {
    color: var(--brand, #2563EB);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.breadcrumb-active-sm {
    color: #0f172a;
    font-weight: 600;
}

.header-title-section .breadcrumb .breadcrumb-separator {
    font-size: 13px;
    padding: 0 2px;
}

#instancePageTitle {
    font-size: 24px;
    line-height: 36px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto !important;
    padding: 10px 20px;
}

.header-actions .btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.header-actions .btn span {
    font-size: 16px;
}

.logout-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* Dashboard Footer */
.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #e0f2fe;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    margin-left: 260px;
}

.dashboard-footer p {
    margin: 0;
    font-size: 14px;
    color: #2563EB;
    opacity: 0.9;
}

.dashboard-footer strong {
    font-weight: 600;
}

/* Dashboard Content */
.dashboard-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    min-height: calc(100vh - 165px);
    position: relative;
    overflow: hidden;
}

.content-section {
    display: block;
}

/* File Browser */
.file-browser {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.folders-section,
.files-section {
    margin-bottom: 24px;
}

.folders-section:last-child,
.files-section:last-child {
    margin-bottom: 0;
}

.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.items-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Folder items - grid and list styles */
.item.folder {
    padding: 18px 20px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    background: white;
    cursor: pointer;
}

.items-list.list-view .item.folder {
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.item.folder:hover {
    border-color: #2563EB;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.15);
}

.items-list.list-view .item.folder:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.item.folder .icon {
    font-size: 28px;
    flex-shrink: 0;
}

.item.folder .name {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
    color: #1e293b;
    font-size: 15px;
}

/* File list items - grid and list styles */
.file-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.items-list:not(.list-view) .file-list-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    min-height: 140px;
}

.items-list:not(.list-view) .file-list-item:hover {
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.1);
}

.items-list:not(.list-view) .file-info {
    width: 100%;
    flex: 1;
}

.items-list:not(.list-view) .file-download-btn {
    align-self: flex-end;
    margin-top: auto;
}

.file-list-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.file-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 8px;
    color: #2563EB;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
    line-height: 1.4;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.file-size {
    font-weight: 500;
}

.file-separator {
    color: #cbd5e1;
}

.file-date {
    color: #94a3b8;
}

.file-download-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.file-download-btn:hover {
    background: #1D4ED8;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.file-download-btn:active {
    transform: scale(0.98);
}

.file-download-btn svg {
    width: 18px;
    height: 18px;
}

/* Load More Button */
.load-more-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-top: 16px;
}

.items-list.list-view .load-more-container {
    width: 100%;
}

.load-more-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
}

.empty {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* Admin Panel */
.admin-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-section:last-child {
    border-bottom: none;
}

.admin-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.admin-form {
    max-width: 500px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-admin {
    background: #dc3545;
    color: white;
}

.badge-user {
    background: #28a745;
    color: white;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    max-width: 400px;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.toast-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.toast-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Legacy message styles (for backward compatibility) */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #c33;
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #64748b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0f2fe;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        width: 240px;
    }

    .dashboard-main {
        margin-left: 240px;
        padding: 20px;
        padding-bottom: 80px;
    }

    .dashboard-footer {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }

    .dashboard-main {
        margin-left: 0;
        padding: 20px;
        padding-bottom: 80px;
    }

    .dashboard-footer {
        margin-left: 0;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-logos {
        border-right: none;
        border-bottom: 2px solid #e0f2fe;
        padding-right: 0;
        padding-bottom: 15px;
        width: 100%;
        justify-content: center;
    }

    .header-title-section {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .items-list {
        grid-template-columns: 1fr;
    }
    
    .item.file {
        flex-direction: column;
        align-items: flex-start;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }

    .auth-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-panel {
        padding: 36px 24px 28px;
        min-height: auto;
    }

    .auth-panel h1 {
        font-size: 30px;
    }

    .auth-form {
        order: -1;
        padding: 32px 24px 24px;
    }

    .auth-feature h3,
    .auth-feature p {
        max-width: none;
    }

    /* Login Page Responsive */
    .login-container {
        flex-direction: column;
    }

    .login-left {
        padding: 40px 30px;
        min-height: auto;
    }

    .login-right {
        padding: 40px 30px;
    }

    .maxximu-logo {
        max-width: 150px;
    }

    .brand-title {
        font-size: 28px;
    }

    .brand-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .brand-features {
        margin-top: 30px;
        gap: 15px;
    }

    .ngl-logo {
        max-width: 200px;
    }

    .login-title {
        font-size: 26px;
    }
}

/* Users Management Styles */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.users-search {
    flex: 1;
    min-width: 0;
}

.search-input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e0f2fe;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

#createUserBtn {
    width: auto;
    padding: 12px 24px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-input:focus {
    outline: none;
    border-color: #2563EB;
}

.users-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

.users-table thead {
    background: #f8fafc;
}

.users-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 700;
    color: #0c67a5;
    font-size: 11px;
    text-transform: none;
    border-bottom: 2px solid #f1f5f9;
}

.users-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 12px;
    vertical-align: middle;
}

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

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

/* Updated Role Badges */
.role-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: #fef2f2;
    color: #ef4444;
}

.role-badge.user {
    background: #eff6ff;
    color: #3b82f6;
}

.role-badge.superadmin {
    background: #faf5ff;
    color: #9333ea;
}

.user-action-btns {
    display: flex;
    gap: 10px;
}

.user-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    height: 32px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Note: edit/delete colour styles are defined in the unified block below */

.secret-key-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.masked-key {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #64748b;
    letter-spacing: 1px;
}

.copy-key-btn {
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 4px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.copy-key-btn:hover {
    background: #f1f5f9;
    color: #2563EB;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    background: #e0f2fe;
    color: #2563EB;
}

.btn-edit:hover {
    background: #bae6fd;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Secret Key Cell Styles */
.secret-key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.secret-masked {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #64748b;
    letter-spacing: 2px;
}

.btn-copy-secret {
    background: transparent;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    color: #2563EB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-copy-secret:hover {
    background: #f0f9ff;
    opacity: 1;
    transform: scale(1.1);
}

.btn-copy-secret svg {
    width: 14px;
    height: 14px;
}

/* Right-side drawer */
.drawer {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.drawer-panel {
    width: min(440px, 100%);
    height: 100%;
    background: #fff;
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    animation: drawerIn 0.24s ease;
}

@keyframes drawerIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer .modal-header {
    padding: 14px 20px;
}

.drawer .modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 14px 20px 12px;
}

.drawer .form-group {
    margin-bottom: 12px;
}

.drawer .form-group label {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.drawer .form-group input,
.drawer .form-group select,
.drawer .select-styled {
    padding: 8px 12px;
    border-width: 1px;
    border-color: #e2e8f0;
    border-radius: 8px;
}

.drawer .form-hint {
    margin-top: 4px;
    font-size: 12px;
    font-style: normal;
    line-height: 1.35;
}

.drawer .password-with-generate .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.drawer .modal-footer {
    margin-top: auto;
    padding-top: 12px;
}

.drawer .modal-footer .btn {
    width: auto;
}

.drawer .modal-footer .btn-primary {
    min-width: 120px;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-bottom-color: #fff;
    border-radius: 50%;
    display: none;
    box-sizing: border-box;
    animation: rotation 0.7s linear infinite;
    flex: 0 0 14px;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
}

.drawer-panel-wide {
    width: min(640px, 100%);
}

.switch {
    position: relative;
    display: inline-flex;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.switch input:checked + .switch-slider {
    background: #0c67a5;
}

.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.55;
    cursor: wait;
}

.history-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 14px;
}

.history-empty {
    color: #64748b;
    font-size: 14px;
    padding: 24px 0;
    text-align: center;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-value-col {
    width: 72px;
    white-space: nowrap;
}

.history-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

.history-device {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0f2fe;
}

.modal-header h3 {
    margin: 0;
    color: #2563EB;
    font-size: 20px;
}

.modal-close {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 0;
    line-height: 0;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.modal-close svg {
    display: block;
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.modal-close:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.modal-body {
    padding: 25px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.field-error {
    display: block;
    margin: 6px 0 0;
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    line-height: 1.4;
}

.form-group input.input-invalid,
.form-group select.input-invalid,
.ts-wrapper.input-invalid .ts-control {
    border-color: #dc2626 !important;
}

.drawer .ts-wrapper {
    width: 100%;
}

.form-group input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.7;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0f2fe;
}

/* Delete Confirmation Modal Styles */
.delete-modal {
    max-width: 480px;
}

.delete-modal-header {
    display: flex;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e0f2fe;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.delete-modal-header h3 {
    color: #2563EB;
    font-size: 24px;
    margin: 0;
    font-weight: 700;
}

.delete-modal-body {
    padding: 30px;
    text-align: center;
}

.delete-message {
    font-size: 17px;
    color: #1e293b;
    margin: 0 0 25px 0;
    font-weight: 500;
    line-height: 1.5;
}

.delete-user-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 0 0 20px 0;
    border: 2px solid #bae6fd;
    text-align: left;
}

.user-info-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.user-info-value {
    color: #2563EB;
    font-size: 18px;
    font-weight: 700;
    word-break: break-word;
}

.delete-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.delete-warning svg {
    width: 16px;
    height: 16px;
    color: #2563EB;
    flex-shrink: 0;
}

.delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #e0f2fe;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
}

.delete-modal-footer .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-modal-footer .btn-primary svg {
    width: 16px;
    height: 16px;
}

/* 404 */
body.not-found-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background-color: #f4f7fb;
    background-image: radial-gradient(#d5deea 1.1px, transparent 1.1px);
    background-size: 18px 18px;
    color: var(--ink);
    position: relative;
    overflow: hidden;
}

.not-found-glow {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 68%);
    pointer-events: none;
}

.not-found {
    position: relative;
    width: min(560px, 100%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.not-found-brand {
    margin-bottom: 28px;
}

.not-found-brand img {
    height: 36px;
    width: auto;
    display: block;
}

.not-found-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 22px;
    font-size: 104px;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.9;
    background: linear-gradient(180deg, #1d4ed8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.not-found-orbit {
    width: 88px;
    height: 88px;
    margin: 0 8px;
    border-radius: 50%;
    border: 3px solid #2563eb;
    background: #fff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.16);
    flex: 0 0 88px;
}

.not-found-orbit svg {
    width: 34px;
    height: 34px;
}

.not-found-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e6ebf2;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 12px 6px 10px;
    margin-bottom: 14px;
}

.not-found-kicker .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
}

.not-found h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 8px;
}

.not-found-copy {
    color: #64748b;
    font-size: 15px;
    line-height: 1.55;
    max-width: 400px;
    margin-bottom: 28px;
}

.not-found-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.not-found-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.not-found-btn.primary {
    background: #2563eb;
    color: #fff;
}

.not-found-btn.primary:hover {
    background: #1d4ed8;
}

.not-found-btn.ghost {
    background: #fff;
    color: var(--ink);
    border-color: #e2e8f0;
}

.not-found-btn.ghost:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

@media (max-width: 520px) {
    .not-found-code {
        font-size: 72px;
    }

    .not-found-orbit {
        width: 62px;
        height: 62px;
        flex-basis: 62px;
    }

    .not-found-orbit svg {
        width: 26px;
        height: 26px;
    }

    .not-found h1 {
        font-size: 26px;
    }

    .not-found-actions {
        width: 100%;
        flex-direction: column;
    }

    .not-found-btn {
        width: 100%;
    }
}


/* VM Dashboard Styles */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

#dashboardOverview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#dashboardOverview .overview-card {
    --tone: #0c67a5;
    --tone-soft: #e8f3fa;
    position: relative;
    min-height: 132px;
    padding: 20px 22px 20px 24px;
    padding-right: 84px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

#dashboardOverview .overview-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tone);
}

#dashboardOverview .overview-card::after {
    content: '';
    position: absolute;
    right: -38px;
    bottom: -38px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--tone-soft);
    opacity: 0.55;
    pointer-events: none;
}

#dashboardOverview .overview-card:hover {
    transform: translateY(-2px);
    border-color: var(--tone);
    box-shadow: 0 12px 26px -14px rgba(15, 23, 42, 0.22);
}

#dashboardOverview .overview-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tone-soft);
    color: var(--tone);
    transition: transform 0.2s;
}

#dashboardOverview .overview-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

#dashboardOverview .overview-card:hover .overview-icon {
    transform: scale(1.06);
}

#dashboardOverview .overview-link {
    position: relative;
    z-index: 1;
    margin-top: auto;
    color: var(--tone);
}

#dashboardOverview .overview-link::after {
    content: ' \2192';
    transition: margin-left 0.2s;
}

#dashboardOverview .overview-card:hover .overview-link::after {
    margin-left: 4px;
}

#dashboardOverview .dash-card-machines { --tone: #2563eb; --tone-soft: #e0ecff; }
#dashboardOverview .dash-card-alerts { --tone: #d97706; --tone-soft: #fef3c7; }
#dashboardOverview .dash-card-site { --tone: #0c67a5; --tone-soft: #e0f0fa; }
#dashboardOverview .dash-card-database { --tone: #0f766e; --tone-soft: #d5f5ef; }
#dashboardOverview #backupSizeCard { --tone: #7c3aed; --tone-soft: #ede9fe; }
#dashboardOverview #databaseSizeCard { --tone: #db2777; --tone-soft: #fce7f3; }

@media (max-width: 1024px) {
    #dashboardOverview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    #dashboardOverview { grid-template-columns: 1fr; }
}

.dash-metrics {
    margin-top: 22px;
}

.dash-metrics[hidden] {
    display: none;
}

.dash-metrics-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dash-metrics-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink, #0f172a);
}

.dash-metrics-head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}

.dash-metrics-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-metrics-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand, #0c67a5);
    text-decoration: none;
}

.dash-metrics-link::after {
    content: ' \2192';
}

.dash-metrics-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dash-chart-card {
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    padding: 16px 16px 6px;
    min-width: 0;
}

.dash-chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink, #0f172a);
    margin-bottom: 4px;
}

.dash-chart-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dash-chart-icon svg {
    display: block;
    width: 17px;
    height: 17px;
}

.dash-chart-icon.tone-blue { background: #e0ecff; color: #0a6aaf; }
.dash-chart-icon.tone-green { background: #d1fae5; color: #059669; }

@media (max-width: 1024px) {
    .dash-metrics-grid { grid-template-columns: 1fr; }
}

.dash-board {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 22px;
}

.dash-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    min-width: 0;
}

.dash-panel .recent-alerts-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-kind {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dash-kind.files {
    background: #e0f2fe;
    color: #0c67a5;
}

.dash-kind.database {
    background: #ccfbf1;
    color: #0f766e;
}

.dash-panel .users-table-container {
    box-shadow: none;
}

.dash-panel .users-table th,
.dash-panel .users-table td {
    white-space: nowrap;
}

.dash-clip {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.overview-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.overview-card:hover {
    border-color: #2563eb;
}

.overview-card strong {
    font-size: 32px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.overview-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.overview-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
}

.recent-alerts {
    margin-top: 28px;
}

.recent-alerts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.recent-alerts-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.recent-alerts-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.recent-alerts .btn {
    width: auto;
    white-space: nowrap;
}

.dashboard-backup-runs-head {
    margin-top: 28px;
}

.overview-card strong.backup-size-value {
    font-size: 28px;
}

.backup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.backup-panel {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    padding: 22px;
}

.backup-panel h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.backup-note,
.backup-panel .recent-alerts-head p {
    margin: 6px 0 16px;
    color: #64748b;
    font-size: 13px;
}

.backup-panel .btn,
.backup-actions .btn {
    width: auto;
}

.backup-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

.schedule-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.schedule-form .form-group,
.schedule-form input[type="time"],
.schedule-form select {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.schedule-list {
    margin-top: 8px;
}

.schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.schedule-row .user-action-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    flex: 0 0 32px;
}

.schedule-row strong {
    font-size: 16px;
    color: #0f172a;
}

.schedule-empty {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 13px;
}

.backup-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 8px 0 4px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.backup-last-run {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.backup-run-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
}

.backup-run-icon svg {
    width: 13px;
    height: 13px;
}

.backup-run-icon.success,
.backup-status.success { background: #dcfce7; color: #166534; }
.backup-run-icon.failed,
.backup-status.failed { background: #fee2e2; color: #991b1b; }
.backup-run-icon.running,
.backup-status.running { background: #dbeafe; color: #1d4ed8; }
.backup-run-icon.expired,
.backup-status.expired { background: #f1f5f9; color: #475569; }

.backup-status .backup-run-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    background: transparent;
}

.backup-tabs {
    margin-bottom: 18px;
}

.backup-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.backup-tabs .tab-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.backup-db-load {
    width: auto;
    white-space: nowrap;
}

.backup-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.backup-page-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.backup-page-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.backup-page-head .btn {
    width: auto;
    white-space: nowrap;
}

.drawer .modal-footer .btn {
    width: auto;
}

.backup-search {
    min-width: 220px;
}

.backup-search input {
    width: 100%;
}

#backupHistory td {
    max-width: 280px;
    word-break: break-word;
}

@media (max-width: 980px) {
    .backup-layout {
        grid-template-columns: 1fr;
    }

    .schedule-form {
        flex-wrap: wrap;
    }
}

.vm-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.vm-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 0;
    min-height: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    overflow: hidden;
}

.vm-row-top {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.vm-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.vm-card:hover {
    box-shadow: 0 8px 18px -8px rgba(15, 23, 42, 0.18);
    border-color: #2563EB;
}

.vm-row-identity {
    flex: 0 0 240px;
    width: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 20px;
    border-right: 1px solid #e2e8f0;
}

.vm-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.vm-row-title .vm-actions {
    margin-left: 4px;
}

.vm-row-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 0;
    border-left: 0;
    background: transparent;
}

.vm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.vm-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.vm-status-dot.running { background-color: #22c55e; box-shadow: 0 0 8px #22c55e; }
.vm-status-dot.stopped { background-color: #ef4444; }
.vm-status-dot.pending { background-color: #f59e0b; }

.vm-name {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.vm-instance-id {
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 8px;
    width: fit-content;
}

.vm-stats {
    display: grid;
    grid-template-columns: 1.25fr 0.7fr 1fr 1.05fr 1.15fr;
    flex: 1;
    min-width: 0;
    align-items: stretch;
}

.vm-stat {
    background: transparent;
    border: 0;
    border-radius: 0;
    border-right: 1px solid #f1f5f9;
    padding: 18px 16px;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vm-stat:last-child {
    border-right: 0;
}

.vm-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.vm-stat-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
}

.vm-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.alert-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-badge-container svg {
    color: #94a3b8;
}

.alert-badge-container.has-alerts {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-badge-container.has-alerts svg {
    color: #059669;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #15803d;
}

.vm-row-side .alert-badge-container,
.vm-row-side .status-indicator,
.vm-row-side .btn-view-status {
    height: 36px;
    box-sizing: border-box;
}

.vm-row-side .status-indicator {
    padding: 0 4px;
    white-space: nowrap;
}

.status-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-view-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #2563EB;
    font-size: 13px;
    font-weight: 700;
    background: #f0f9ff;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #bae6fd;
    transition: all 0.2s;
    white-space: nowrap;
}

.vm-card:hover .btn-view-status {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

@media (max-width: 1100px) {
    .vm-row-top {
        flex-wrap: wrap;
    }

    .vm-row-identity {
        flex: 1 1 100%;
        width: auto;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .vm-stats {
        flex: 1 1 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vm-stat:nth-child(3) {
        border-right: 0;
    }

    .vm-row-bottom {
        flex-wrap: wrap;
    }

    .vm-row-side {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

.vm-row-bottom .vm-actions {
    margin-left: 0;
    opacity: 1;
}

.vm-row-bottom .action-btn {
    width: auto;
    height: 36px;
    padding: 0 12px;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.vm-row-bottom .action-btn.delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.vm-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.vm-card:hover .vm-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #2563EB;
}

.action-btn.delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.vm-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-row .label { color: #64748b; }

/* Password Input Wrapper & Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    height: 100%;
    z-index: 10;
}

.password-toggle:hover {
    color: #2563EB;
}

.password-input-wrapper input {
    padding-right: 40px !important;
    width: 100%;
}

/* Tom Select Customization (Optional but nice) */
.ts-control {
    border-radius: 8px !important;
    padding: 10px !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 14px !important;
}

.ts-dropdown {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 2000 !important;
}
.info-row .value { color: #1e293b; font-family: monospace; }

.vm-footer {
    display: flex;
    justify-content: flex-end;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.running { background-color: #dcfce7; color: #166534; }
.status-badge.stopped { background-color: #fee2e2; color: #991b1b; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content.wide {
    max-width: 800px;
}

.vm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-item span {
    font-size: 16px;
    color: #1e293b;
    font-weight: 500;
}

.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.status-pill.running { background: #dcfce7; color: #166534; }
.status-pill.stopped { background: #fee2e2; color: #991b1b; }

.tags-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    margin-top: 40px;
}

.empty-icon { font-size: 48px; margin-bottom: 20px; }
.empty-state h2 { color: #1e293b; margin-bottom: 8px; }
.empty-state p { color: #64748b; }

/* Role Pills */
.role-pill {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.role-pill.admin { background: #fee2e2; color: #991b1b; }
.role-pill.user { background: #e0f2fe; color: #0369a1; }


/* VM Management Form */
.vm-management-form {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.vm-management-form .form-row {
    display: flex;
    gap: 12px;
}

.vm-management-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.vm-management-form input:focus {
    border-color: #2563EB;
    outline: none;
}

/* Metrics Dashboard */
.metric-mini {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.metric-mini .label {
    color: #64748b;
}

.metric-mini .value {
    font-weight: 500;
    color: #1e293b;
}

.vm-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.metric-card label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card .metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

/* --- Toggle Switch Styled --- */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #0c67a5;
}

input:focus + .slider {
  box-shadow: 0 0 1px #0c67a5;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Alert System Components */
.firing-badge {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.firing-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Layout Utilities */
.flex-column-start {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.subtitle-standard {
    margin: 2px 0 0 0;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 400;
}

.header-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-icon-left {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-full-width {
    width: 100%;
}

.input-styled {
    padding: 12px 12px 12px 40px;
    border: 1px solid #e1e7ef;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    transition: all 0.2s;
}

.input-styled:focus {
    border-color: #2563EB;
    background: white;
}

.empty-state-container {
    display: none;
    padding: 80px 0;
    text-align: center;
    margin: 20px;
}

.empty-state-icon {
    margin-bottom: 20px;
}

.empty-state-title {
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state-text {
    color: #64748b;
}

/* Status Check Hint */
.status-hint-box {
    display: none;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    color: #0369a1;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Common Utility Classes */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-8 { gap: 8px; }
.flex-gap-15 { gap: 15px; }

.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-20 { margin-bottom: 20px; }
.pt-20 { padding-top: 20px; }

.text-muted-sm { color: #94a3b8; font-size: 12px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.m-0 { margin: 0; }

/* Dashboard Specific Components */
.timezone-badge {
    display: flex;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.chart-data-source {
    margin-top: 24px;
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-add-alert {
    background: #eff6ff;
    color: #0c67a5;
    border-color: #bee3f8;
}

/* Modal sizing & formatting */
.modal-content-sm { max-width: 500px; }

.delete-confirm {
    z-index: 1200;
}

.delete-confirm .modal-content {
    overflow: hidden;
}

.delete-confirm-header {
    background: #fff1f2;
    border-bottom: 1px solid #fecaca;
}

.delete-confirm-header h3,
.delete-confirm-header .modal-close {
    color: #e11d48;
}

.delete-confirm-message {
    margin: 0 0 14px;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.5;
}

.delete-confirm-detail {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.delete-confirm-value {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    word-break: break-word;
}

.delete-confirm-warning {
    margin: 0;
    color: #e11d48;
    font-size: 13px;
    font-weight: 600;
}

.delete-confirm .modal-footer {
    align-items: center;
    margin-top: 0;
    padding: 16px 24px 20px;
}

.delete-confirm .modal-footer .btn {
    width: auto;
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transform: none;
}

.delete-confirm .modal-footer .btn-outline {
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.delete-confirm .modal-footer .btn-outline:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
    transform: none;
    box-shadow: none;
}

.delete-confirm .modal-footer .delete-confirm-btn {
    background: #e11d48;
    color: #fff;
    border: 1px solid #e11d48;
}

.delete-confirm .modal-footer .delete-confirm-btn:hover {
    background: #be123c;
    color: #fff;
    border-color: #be123c;
    transform: none;
    box-shadow: none;
}

.run-confirm-mark {
    display: none;
}

.run-confirm .modal-content {
    position: relative;
    max-width: 420px;
    border-radius: 16px;
}

.run-confirm .delete-confirm-header {
    position: relative;
    background: #fff;
    border-bottom: none;
    padding: 22px 24px 0;
    justify-content: center;
}

.run-confirm .delete-confirm-header h3 {
    width: 100%;
    text-align: center;
    color: #0f172a;
    font-size: 18px;
}

.run-confirm .delete-confirm-header .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #64748b;
}

.run-confirm .modal-body {
    padding: 16px 28px 4px;
    text-align: center;
}

.run-confirm .run-confirm-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
}

.run-confirm .delete-confirm-message {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
}

.run-confirm .delete-confirm-detail {
    text-align: left;
    background: #f8fafc;
    margin-bottom: 12px;
}

.run-confirm .delete-confirm-warning {
    color: #64748b;
    font-weight: 500;
    line-height: 1.45;
}

.run-confirm .modal-footer {
    border-top: none;
    justify-content: center;
    gap: 10px;
    padding: 8px 28px 24px;
}

.run-confirm .modal-footer .delete-confirm-btn {
    background: #16a34a;
    border-color: #16a34a;
}

.run-confirm .modal-footer .delete-confirm-btn:hover {
    background: #15803d;
    border-color: #15803d;
}
.modal-content-md { max-width: 700px; }

/* Layout Utilities */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.flex-1 {
    flex: 1;
}

.select-styled {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* Instance Detail Page Components */
.tabs-container {
    margin-bottom: 24px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    display: inline-flex;
    border: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #2563EB;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-height: 450px;
}

.stats-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s;
}

.stat-box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-box label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.stat-box .value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    word-break: break-word;
}

.instance-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.instance-stat {
    --tone: #0c67a5;
    --tone-soft: #e8f3fa;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.instance-stat::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tone);
}

.instance-stat:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px -12px rgba(15, 23, 42, 0.18);
}

.instance-stat-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tone-soft);
    color: var(--tone);
}

.instance-stat-icon svg {
    display: block;
    width: 22px;
    height: 22px;
}

.instance-stat-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.instance-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}

.instance-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instance-stat-value.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 15px;
}

.instance-stat-value.small {
    font-size: 15px;
}

.instance-stat-bar {
    display: block;
    height: 6px;
    margin-top: 4px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.instance-stat-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #16a34a;
    border-radius: inherit;
    transition: width 0.5s ease;
}

.instance-stat-bar > span.is-warning { background: #f59e0b; }
.instance-stat-bar > span.is-danger { background: #dc2626; }

.instance-stat.tone-slate { --tone: #475569; --tone-soft: #f1f5f9; }
.instance-stat.tone-blue { --tone: #0c67a5; --tone-soft: #e8f3fa; }
.instance-stat.tone-green { --tone: #16a34a; --tone-soft: #dcfce7; }
.instance-stat.tone-violet { --tone: #7c3aed; --tone-soft: #ede9fe; }
.instance-stat.tone-amber { --tone: #d97706; --tone-soft: #fef3c7; }
.instance-stat.tone-cyan { --tone: #0891b2; --tone-soft: #cffafe; }
.instance-stat.tone-red { --tone: #dc2626; --tone-soft: #fee2e2; }

@media (max-width: 1024px) {
    .instance-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .instance-stats { grid-template-columns: 1fr; }
}

.status-pill {
    height: 38px;
    min-width: 140px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-pill.running {
    background-color: #f0fdf4;
    color: #15803d;
}

/* Instance Pills & Badges */
.status-pill.warning {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
    animation: pulse-warning 2s infinite;
}

.status-pill.stopped {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Animations */
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulse-warning {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Specific Buttons */
.btn-header {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    height: 38px;
    min-width: 100px;
}

.btn-primary {
    background: #0c67a5;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(12, 103, 165, 0.2);
}

.btn-primary:hover {
    background: #0a568a;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(12, 103, 165, 0.3);
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 20px;
    color: #64748b;
    cursor: pointer;
}

.btn-logout {
    background: #0c67a5;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(12, 103, 165, 0.2);
}

.btn-logout:hover {
    background: #0a568a;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(12, 103, 165, 0.3);
}

.range-btn {
    background: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 1px solid #e2e8f0;
}

.range-btn:last-child {
    border-right: none;
}

.range-btn.active {
    color: #0c67a5;
    background: #f1f5f9;
    font-weight: 700;
}

.range-btn:hover:not(.active) {
    background: #f8fafc;
    color: #1e293b;
}

/* Toolbar & Chart Utilities */
.chart-toolbar {
    display: flex; 
    gap: 20px; 
    margin-bottom: 24px; 
    align-items: center; 
    flex-wrap: wrap; 
    background: #f8fafc; 
    padding: 6px 16px; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tabs-glass {
    margin-bottom: 0; 
    background: rgba(255,255,255,0.8); 
    padding: 3px; 
    border-radius: 10px; 
    border: 1px solid #e2e8f0;
}

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

.toolbar-divider {
    width: 1px; 
    height: 24px; 
    background: #e2e8f0;
}

.control-group-styled {
    display: flex; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    background: white; 
    padding: 3px;
    margin: 5px;
}

.select-clean {
    border: none; 
    padding: 6px 10px; 
    border-radius: 6px; 
    color: #475569; 
    font-weight: 500; 
    outline: none; 
    background: transparent; 
    cursor: pointer; 
    font-size: 13px;
}

.range-selector-styled {
    display: flex; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    background: white; 
    padding: 2px; 
    overflow: hidden;
}

/* User Action Buttons */
.user-action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.user-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #64748b;
    padding: 0;
}

.user-action-btn:hover {
    transform: translateY(-1px);
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.user-action-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2px;
}

/* ── Action button colour variants (user & alert buttons unified) ── */

/* Edit — blue tint */
.user-action-btn.edit-user-btn,
.user-action-btn.edit-alert-btn,
.user-action-btn.edit-backup-btn {
    background: #e0f2fe;
    color: #0c67a5;
    border-color: #bae6fd;
}

.user-action-btn.edit-user-btn:hover,
.user-action-btn.edit-alert-btn:hover,
.user-action-btn.edit-backup-btn:hover {
    background: #bae6fd;
    color: #0a5a9a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(12, 103, 165, 0.12);
}

/* Delete — red tint */
.user-action-btn.delete-user-btn,
.user-action-btn.delete-alert-btn,
.user-action-btn.delete-backup-btn,
.user-action-btn.delete {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

.user-action-btn.delete-user-btn:hover,
.user-action-btn.delete-alert-btn:hover,
.user-action-btn.delete-backup-btn:hover,
.user-action-btn.delete:hover {
    background: #fecaca;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.12);
}

/* History — green tint */
.user-action-btn.history-alert-btn {
    background: #f0fdf4;
    color: #166534;
    border-color: #1665343d;
}

.user-action-btn.history-user-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.user-action-btn.history-user-btn:hover {
    background: #dbeafe;
    color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.12);
}

.user-action-btn.run-backup-btn {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.user-action-btn.run-backup-btn:hover {
    background: #dcfce7;
    color: #14532d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(22, 101, 52, 0.12);
}

.user-action-btn.download-backup-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.user-action-btn.download-backup-btn:hover {
    background: #dbeafe;
    color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.12);
}

/* Loading Overlay with Premium Blur */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
}

.blur-loading {
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay p {
    color: #0c67a5;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

/* Modern Spinner */
.loader {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-bottom-color: #0c67a5;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.activity-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.activity-filters .form-group {
    margin: 0;
    min-width: 180px;
}

.activity-filters .form-group label {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.activity-filters .form-group input,
.activity-filters .form-group select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.activity-filters .btn {
    width: 118px;
    min-width: 118px;
    height: 40px;
    padding: 0 12px;
    flex: 0 0 118px;
    gap: 8px;
}

.activity-filters .btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.activity-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.activity-pager[hidden] {
    display: none;
}

.activity-pager-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.activity-pager-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.activity-page-btn {
    height: 36px;
    min-width: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.activity-page-btn:hover:not(:disabled):not(.active) {
    background: #fafaf9;
}

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

.activity-page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.activity-page-gap {
    min-width: 16px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

/* Shared surface: type, buttons, auth, and app chrome */
button,
input,
select,
textarea {
    font-family: var(--font);
}

body.dashboard-page,
.dashboard-wrapper {
    background: var(--canvas);
}

.dashboard-sidebar {
    background: #fafaf9;
    border-right: 1px solid var(--line);
}

.sidebar-header {
    border-bottom-color: var(--line);
}

.menu-item {
    color: #44403c;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.menu-item:hover {
    background: #f5f5f4;
    color: var(--ink);
}

.menu-item.active {
    background: #e8f3fa;
    color: var(--brand);
}

.dashboard-header,
.dashboard-content {
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.dashboard-header h1,
.auth-panel h1,
.auth-form h2,
.not-found h1,
.backup-page-head h2,
.recent-alerts-head h2 {
    letter-spacing: -0.04em;
    font-weight: 700;
}

.subtitle-standard,
.auth-lead,
.auth-form .login-subtitle {
    color: var(--muted);
}

.overview-card,
.dash-panel,
.backup-panel,
.chart-card,
.auth-feature {
    border-color: var(--line);
    border-radius: 16px;
    box-shadow: none;
}

.dash-panel,
.users-table thead,
.users-table th {
    background: #fafaf9;
}

.overview-card strong {
    letter-spacing: -0.045em;
    font-weight: 700;
}

.overview-label,
.users-table th {
    color: var(--muted);
    font-weight: 600;
}

.users-table th,
.users-table td {
    border-bottom-color: var(--line);
}

.overview-link,
.auth-links a,
.auth-back {
    color: var(--brand);
}

.breadcrumb-link.active,
.breadcrumb-link.active:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn,
.btn-primary,
.btn-outline,
.btn-secondary,
.btn-small,
.btn-header,
.not-found-btn,
.tab-btn {
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 10px;
    box-shadow: none;
}

.btn-primary,
.btn-outline,
.btn-secondary,
.header-actions .btn,
.not-found-btn {
    height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.not-found-btn.primary,
.tab-btn.active,
.btn-small {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
}

.btn-primary:hover,
.not-found-btn.primary:hover,
.btn-small:hover,
.btn-logout:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: #fff;
    color: #44403c;
    border: 1px solid #d6d3d1;
}

.btn-outline:hover {
    background: #fafaf9;
    color: var(--ink);
    border-color: #a8a29e;
    transform: none;
    box-shadow: none;
}

.auth-form .btn-primary,
.auth-form .btn-outline {
    width: 100%;
}

.dashboard-header {
    padding: 16px 20px;
    align-items: center;
}

.header-logout {
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.header-logout svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: block;
}

.header-logout:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.header-actions .status-pill,
.header-actions .btn-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    min-width: 0;
    padding: 0 14px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    box-shadow: none;
}

.header-actions .btn-header {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    cursor: pointer;
}

.header-actions .btn-refresh:hover {
    background: #fafaf9;
    border-color: #a8a29e;
}

.header-actions .btn-delete {
    background: #fff;
    color: #b91c1c;
    border-color: #fecaca;
}

.header-actions .btn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.header-actions .status-pill.running {
    border: 1px solid #bbf7d0;
}

.header-actions .status-pill.warning {
    border: 1px solid #fde68a;
}

.header-actions .status-pill.stopped {
    border: 1px solid #fecaca;
}

.header-actions .status-pill svg,
.header-actions .btn-header svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: block;
}

.modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 40px;
    padding: 0 16px;
    line-height: 1;
}

.modal-footer .btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: block;
}

.modal-footer .btn.is-loading .btn-lead-icon {
    display: none;
}

.auth-panel {
    background: var(--canvas);
    background-image: none;
}

.auth-badge,
.auth-feature {
    border-color: var(--line);
    box-shadow: none;
}

.auth-form .form-group input,
.form-group input,
.form-group select,
.select-styled,
.input-styled {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}

.auth-form .form-group input:focus,
.form-group input:focus,
.form-group select:focus,
.input-styled:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(12, 103, 165, 0.14);
    outline: none;
}

body.not-found-page {
    background: var(--canvas);
    background-image: none;
}

.not-found-glow {
    background: radial-gradient(circle, rgba(12, 103, 165, 0.12), transparent 68%);
}

.sidebar-pulse {
    --pulse: var(--brand, #0c67a5);
    --pulse-soft: rgba(12, 103, 165, 0.12);
    --pulse-speed: 2.4s;
    display: block;
    margin-top: 16px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    border: 1px solid var(--line, #e7e5e4);
    background: linear-gradient(180deg, #eef6fb 0%, #ffffff 70%);
    color: var(--ink, #1c1917);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.sidebar-pulse:hover {
    transform: translateY(-2px);
    border-color: var(--pulse);
    box-shadow: 0 10px 22px -14px rgba(12, 103, 165, 0.45);
}

.sidebar-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(12, 103, 165, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 103, 165, 0.06) 1px, transparent 1px);
    background-size: 12px 12px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
    pointer-events: none;
}

.sidebar-pulse > * {
    position: relative;
}

.sidebar-pulse[data-state="warning"] { --pulse: #d97706; --pulse-soft: rgba(217, 119, 6, 0.12); --pulse-speed: 1.6s; }
.sidebar-pulse[data-state="critical"] { --pulse: #dc2626; --pulse-soft: rgba(220, 38, 38, 0.12); --pulse-speed: 1s; }
.sidebar-pulse[data-state="unknown"],
.sidebar-pulse[data-state="loading"] { --pulse: var(--muted, #78716c); --pulse-soft: rgba(120, 113, 108, 0.12); --pulse-speed: 3.2s; }

.sidebar-pulse[data-state="warning"] { background: linear-gradient(180deg, #fff7e6 0%, #ffffff 70%); }
.sidebar-pulse[data-state="critical"] { background: linear-gradient(180deg, #fdecec 0%, #ffffff 70%); }
.sidebar-pulse[data-state="unknown"],
.sidebar-pulse[data-state="loading"] { background: linear-gradient(180deg, #f5f5f4 0%, #ffffff 70%); }

.pulse-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pulse);
    box-shadow: 0 0 0 0 var(--pulse);
    animation: pulse-ring var(--pulse-speed) ease-out infinite;
}

.pulse-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #1c1917);
    letter-spacing: 0.01em;
}

.pulse-live {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--pulse);
    background: var(--pulse-soft);
    padding: 3px 6px;
    border-radius: 999px;
}

.pulse-ecg {
    display: block;
    width: 100%;
    height: 40px;
    margin: 10px 0 6px;
    overflow: visible;
}

.pulse-ecg path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pulse-ecg-grid {
    stroke: var(--pulse-soft);
    stroke-width: 1.4;
}

.pulse-ecg-trace {
    stroke: var(--pulse);
    stroke-width: 2;
    stroke-dasharray: 34 66;
    filter: drop-shadow(0 1px 2px var(--pulse-soft));
    animation: pulse-trace var(--pulse-speed) linear infinite;
}

.pulse-status {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pulse);
    margin-bottom: 10px;
}

.pulse-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line, #e7e5e4);
}

.pulse-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pulse-stats strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink, #1c1917);
    line-height: 1.1;
}

.pulse-stats span {
    font-size: 10.5px;
    color: var(--muted, #78716c);
}

@keyframes pulse-trace {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 var(--pulse-soft), 0 0 0 0 var(--pulse); }
    70% { box-shadow: 0 0 0 8px transparent, 0 0 0 0 transparent; }
    100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-dot,
    .pulse-ecg-trace {
        animation: none;
    }
}

.auth-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(12, 103, 165, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 103, 165, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 60%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse at 30% 60%, #000 20%, transparent 75%);
    pointer-events: none;
}

.auth-ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px;
    width: 100%;
    height: 140px;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.auth-ecg path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.auth-ecg-base {
    stroke: rgba(12, 103, 165, 0.1);
    stroke-width: 1.5;
}

.auth-ecg-trace {
    stroke: var(--brand, #0c67a5);
    stroke-width: 2.5;
    stroke-dasharray: 22 78;
    opacity: 0.55;
    filter: drop-shadow(0 2px 6px rgba(12, 103, 165, 0.35));
    animation: auth-ecg-sweep 5s linear infinite;
}

@keyframes auth-ecg-sweep {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

.auth-badge .dot {
    position: relative;
    background: #16a34a;
}

.auth-badge .dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #16a34a;
    animation: auth-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.auth-feature {
    position: relative;
}

.feature-live {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}

.feature-live::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #16a34a;
    opacity: 0;
    animation: auth-ping 4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.auth-feature:nth-child(1) .feature-live::after { animation-delay: 0s; }
.auth-feature:nth-child(2) .feature-live::after { animation-delay: 1s; }
.auth-feature:nth-child(3) .feature-live::after { animation-delay: 2s; }
.auth-feature:nth-child(4) .feature-live::after { animation-delay: 3s; }

.auth-feature .feature-icon {
    animation: auth-check 4s ease-in-out infinite;
}

.auth-feature:nth-child(2) .feature-icon { animation-delay: 1s; }
.auth-feature:nth-child(3) .feature-icon { animation-delay: 2s; }
.auth-feature:nth-child(4) .feature-icon { animation-delay: 3s; }

@keyframes auth-ping {
    0% { transform: scale(1); opacity: 0.6; }
    25%, 100% { transform: scale(2.8); opacity: 0; }
}

@keyframes auth-check {
    0%, 30%, 100% { box-shadow: 0 0 0 0 rgba(12, 103, 165, 0); }
    8% { box-shadow: 0 0 0 5px rgba(12, 103, 165, 0.12); }
}

.auth-form .auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
}

.auth-form .auth-submit .btn-spinner {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.auth-form .auth-submit.is-loading,
.auth-form .auth-submit:disabled {
    cursor: progress;
    opacity: 0.85;
}

.otp-form {
    animation: otp-enter 0.3s ease-out;
}

@keyframes otp-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.otp-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 22px;
    border: 1px solid var(--line, #e7e5e4);
    border-radius: 14px;
    background: linear-gradient(180deg, #eef6fb 0%, #ffffff 100%);
}

.otp-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d6e7f3;
    color: var(--brand, #0c67a5);
}

.otp-icon svg {
    width: 22px;
    height: 22px;
}

.otp-head h3 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink, #1c1917);
}

.otp-head p {
    margin: 0;
    font-size: 13px;
    color: var(--muted, #78716c);
    line-height: 1.45;
    word-break: break-word;
}

.otp-head strong {
    color: var(--ink, #1c1917);
    font-weight: 600;
}

.otp-boxes {
    display: flex;
    align-items: center;
    gap: 10px;
}

.otp-box {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    padding: 0 !important;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink, #1c1917);
    border: 1px solid var(--line, #e7e5e4) !important;
    border-radius: 12px !important;
    background: #fff;
    caret-color: var(--brand, #0c67a5);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.otp-box:focus {
    outline: none;
    border-color: var(--brand, #0c67a5) !important;
    box-shadow: 0 0 0 3px rgba(12, 103, 165, 0.14);
}

.otp-box.is-filled {
    background: #f4f9fc;
    border-color: #b9d6ea !important;
}

.otp-sep {
    flex: 0 0 10px;
    height: 2px;
    border-radius: 2px;
    background: #d6d3d1;
}

.otp-form.otp-error .otp-box {
    border-color: #fca5a5 !important;
    animation: otp-shake 0.35s ease-in-out;
}

@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.otp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.otp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 4px 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand, #0c67a5);
    cursor: pointer;
}

.otp-link svg {
    width: 16px;
    height: 16px;
}

.otp-link:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.otp-link:disabled {
    color: var(--muted, #78716c);
    cursor: default;
}

#otpBackBtn {
    color: var(--muted, #78716c);
}

#otpBackBtn:hover {
    color: var(--ink, #1c1917);
}

.otp-boxes.is-error .otp-box {
    border-color: #fca5a5 !important;
    animation: otp-shake 0.35s ease-in-out;
}

.row-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(12, 103, 165, 0.25);
    border-top-color: var(--brand, #0c67a5);
    border-radius: 50%;
    animation: rotation 0.7s linear infinite;
}

.download-card {
    --tone: var(--brand, #0c67a5);
    --tone-soft: #e8f3fa;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin: 8px 0 18px;
    border: 1px solid var(--line, #e7e5e4);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--tone-soft) 0%, #ffffff 100%);
}

.download-card[data-state="done"] { --tone: #16a34a; --tone-soft: #dcfce7; }
.download-card[data-state="error"] { --tone: #dc2626; --tone-soft: #fee2e2; }

.download-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--tone-soft);
    color: var(--tone);
}

.download-icon svg {
    width: 24px;
    height: 24px;
    display: none;
}

.download-card[data-state="ready"] .icon-ready,
.download-card[data-state="done"] .icon-done,
.download-card[data-state="error"] .icon-error {
    display: block;
}

.download-card h3 {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink, #1c1917);
}

.download-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted, #78716c);
    word-break: break-word;
}

.otp-attempts {
    margin: 10px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #b45309;
}

.otp-attempts.is-last {
    color: #b91c1c;
}

.otp-attempts[hidden],
.login-notice[hidden] {
    display: none;
}

.login-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
}

.login-notice svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.login-notice.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-notice.is-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

@media (max-width: 480px) {
    .otp-boxes { gap: 6px; }
    .otp-box { height: 48px; font-size: 19px; }
    .otp-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .otp-form,
    .otp-form.otp-error .otp-box {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-ecg-trace,
    .auth-badge .dot::after,
    .feature-live::after,
    .auth-feature .feature-icon {
        animation: none;
    }
}