/* =============================================
   LLUW Panel — panel.css
   Color Scheme: Black, White, Red
   ============================================= */

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

   /* ── Variables ── */
   :root {
     --bg:          #0d0d0d;
     --bg-surface:  #161616;
     --bg-card:     #1c1c1c;
     --bg-hover:    #242424;
     --border:      #2a2a2a;
     --border-light:#333333;
   
     --red:         #e63030;
     --red-dark:    #b52222;
     --red-glow:    rgba(230, 48, 48, 0.15);
   
     --text:        #f0f0f0;
     --text-muted:  #888888;
     --text-dim:    #555555;
   
     --sidebar-w:   220px;
     --radius:      10px;
     --radius-sm:   6px;
     --font:        'DM Sans', sans-serif;
     --mono:        'DM Mono', monospace;
   
     --shadow:      0 2px 12px rgba(0,0,0,0.4);
     --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
   }
   
   /* ── Reset ── */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
   html, body {
     height: 100%;
     background: var(--bg);
     color: var(--text);
     font-family: var(--font);
     font-size: 14px;
     line-height: 1.6;
     -webkit-font-smoothing: antialiased;
   }
   a { color: inherit; text-decoration: none; }
   button { cursor: pointer; font-family: var(--font); }
   ul { list-style: none; }
   
   /* ── Layout ── */
   .panel-layout { display: flex; min-height: 100vh; }
   
   /* ── Sidebar ── */
   .sidebar {
     width: var(--sidebar-w);
     height: 100vh;
     background: var(--bg-surface);
     border-right: 1px solid var(--border);
     position: fixed;
     top: 0; left: 0;
     z-index: 100;
     display: grid;
     grid-template-rows: auto auto 1fr auto;
     overflow: hidden;
   }
   
   .sidebar-logo {
     padding: 24px 20px 20px;
     border-bottom: 1px solid var(--border);
     display: flex;
     align-items: center;
     gap: 10px;
     cursor: pointer;
     transition: opacity 0.15s;
     position: relative;
     z-index: 300;
     text-decoration: none;
     flex-shrink: 0;
   }
   .sidebar-logo:hover { opacity: 0.85; }
   
   .sidebar-logo .logo-icon {
     width: 32px; height: 32px;
     background: var(--red);
     border-radius: var(--radius-sm);
     display: flex; align-items: center; justify-content: center;
     font-size: 16px; font-weight: 700; color: #fff;
     flex-shrink: 0;
   }
   
   .sidebar-logo .logo-text { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
   .sidebar-logo .logo-text span { color: var(--red); }
   
   .sidebar-nav { padding: 16px 12px; min-height: 0; overflow-y: auto; overflow-x: hidden; direction: rtl; }
   .sidebar-nav > * { direction: ltr; }
   .sidebar-nav::-webkit-scrollbar { width: 3px; }
   .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
   .sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
   .sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
   
   .nav-section { margin-bottom: 24px; }
   
   .nav-section-label {
     font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
     text-transform: uppercase; color: var(--text-dim);
     padding: 0 8px 8px;
   }
   
   .nav-item {
     display: flex; align-items: center; gap: 10px;
     padding: 9px 10px;
     border-radius: var(--radius-sm);
     color: var(--text-muted);
     font-size: 13.5px; font-weight: 500;
     transition: background 0.15s, color 0.15s;
     cursor: pointer;
     margin-bottom: 2px;
     border: 1px solid transparent;
   }
   .nav-item:hover { background: var(--bg-hover); color: var(--text); }
   .nav-item.active { background: var(--red-glow); color: var(--red); border-color: rgba(230,48,48,0.2); }
   .nav-icon { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
   .nav-item.active .nav-icon { opacity: 1; }
   
   .sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); background: var(--bg-surface); flex-shrink: 0; }
   
   .sidebar-user {
     display: flex; align-items: center; gap: 10px;
     padding: 8px 10px;
     border-radius: var(--radius-sm);
     transition: background 0.15s;
   }
   .sidebar-user:hover { background: var(--bg-hover); }
   
   .user-avatar {
     width: 32px; height: 32px; border-radius: 50%;
     background: var(--red);
     display: flex; align-items: center; justify-content: center;
     font-size: 13px; font-weight: 700; color: #fff;
     flex-shrink: 0;
   }
   .user-info { flex: 1; min-width: 0; }
   .user-name  { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
   .user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
   
   /* ── Main Content ── */
   .panel-main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
   
   /* ── Top Bar ── */
   .topbar {
     height: 60px;
     background: var(--bg-surface);
     border-bottom: 1px solid var(--border);
     padding: 0 28px;
     display: flex; align-items: center; justify-content: space-between;
     position: sticky; top: 0; z-index: 50;
   }
   .topbar-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
   .topbar-actions { display: flex; align-items: center; gap: 12px; }
   
   /* ── Buttons ── */
   .btn {
     display: inline-flex; align-items: center; gap: 7px;
     padding: 8px 16px; border-radius: var(--radius-sm);
     font-size: 13px; font-weight: 600; border: none;
     transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
   }
   .btn:active { transform: scale(0.98); }
   .btn-primary { background: var(--red); color: #fff; }
   .btn-primary:hover { background: var(--red-dark); box-shadow: 0 0 16px var(--red-glow); }
   .btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border-light); }
   .btn-secondary:hover { background: var(--bg-hover); }
   .btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
   .btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
   .btn-danger { background: rgba(230,48,48,0.1); color: var(--red); border: 1px solid rgba(230,48,48,0.25); }
   .btn-danger:hover { background: rgba(230,48,48,0.2); }
   .btn-sm { padding: 5px 11px; font-size: 12px; }
   .btn-lg { padding: 11px 22px; font-size: 14px; }
   
   /* ── Page Content ── */
   .page-content { padding: 28px; flex: 1; }
   
   /* ── Stats Grid ── */
   .stats-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     gap: 16px; margin-bottom: 28px;
   }
   .stat-card {
     background: var(--bg-card); border: 1px solid var(--border);
     border-radius: var(--radius); padding: 20px;
     transition: border-color 0.2s;
   }
   .stat-card:hover { border-color: var(--border-light); }
   .stat-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px; }
   .stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); line-height: 1; }
   .stat-value.red { color: var(--red); }
   .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
   .stat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; }
   .stat-dot.green  { background: #34d399; }
   .stat-dot.red    { background: var(--red); }
   .stat-dot.yellow { background: #fbbf24; }
   
   /* ── Section Header ── */
   .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
   .section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
   
   /* ── Server Cards ── */
   .server-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
     gap: 16px; margin-bottom: 28px;
   }
   .server-card {
     background: var(--bg-card); border: 1px solid var(--border);
     border-radius: var(--radius); overflow: hidden;
     transition: border-color 0.2s, box-shadow 0.2s;
   }
   .server-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
   .server-card-header {
     padding: 16px 18px; border-bottom: 1px solid var(--border);
     display: flex; align-items: center; justify-content: space-between;
   }
   .server-name { font-size: 14px; font-weight: 600; }
   .server-ip { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
   
   .status-badge {
     display: inline-flex; align-items: center; gap: 5px;
     padding: 3px 9px; border-radius: 20px;
     font-size: 11.5px; font-weight: 600;
   }
   .status-badge.online  { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
   .status-badge.offline { background: rgba(230,48,48,0.1);  color: var(--red); border: 1px solid rgba(230,48,48,0.2); }
   .status-badge.stopped { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
   .status-pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
   .status-badge.online .status-pulse { animation: pulse 2s infinite; }
   @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
   
   .server-card-body { padding: 16px 18px; }
   .server-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
   .spec-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px; }
   .spec-value { font-size: 13px; font-weight: 600; }
   
   .resource-bar { margin-bottom: 10px; }
   .resource-bar-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
   .bar-track { height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; }
   .bar-fill { height: 100%; border-radius: 2px; background: var(--red); transition: width 0.5s ease; }
   .bar-fill.green  { background: #34d399; }
   .bar-fill.yellow { background: #fbbf24; }
   
   .server-card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
   
   /* ── Table ── */
   .table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
   table { width: 100%; border-collapse: collapse; }
   thead tr { border-bottom: 1px solid var(--border); }
   th { padding: 12px 16px; text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
   td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
   tr:last-child td { border-bottom: none; }
   tbody tr { transition: background 0.12s; }
   tbody tr:hover { background: var(--bg-hover); }
   
   /* ── Create Server Hero ── */
   .create-hero {
     background: linear-gradient(135deg, var(--red) 0%, #7b1111 100%);
     border-radius: var(--radius) var(--radius) 0 0;
     padding: 24px 28px; position: relative; overflow: hidden;
   }
   .create-hero::before {
     content: ''; position: absolute; inset: 0;
     background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
   }
   .create-hero h2 { font-size: 20px; font-weight: 700; color: #fff; position: relative; }
   .create-hero p  { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; position: relative; }
   
   /* ── Location / Plan Cards ── */
   .location-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
   .location-card {
     border: 1px solid var(--border); border-radius: var(--radius-sm);
     padding: 12px 14px; cursor: pointer;
     transition: border-color 0.15s, background 0.15s;
     background: var(--bg-card);
   }
   .location-card:hover { border-color: var(--border-light); background: var(--bg-hover); }
   .location-card.selected { border-color: var(--red); background: var(--red-glow); }
   .location-name   { font-size: 13.5px; font-weight: 600; }
   .location-region { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
   .location-flag   { font-size: 18px; margin-bottom: 6px; }
   
   .plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
   .plan-card {
     border: 1px solid var(--border); border-radius: var(--radius-sm);
     padding: 16px; cursor: pointer; background: var(--bg-card);
     transition: border-color 0.15s, background 0.15s;
   }
   .plan-card:hover { border-color: var(--border-light); background: var(--bg-hover); }
   .plan-card.selected { border-color: var(--red); background: var(--red-glow); }
   .plan-name  { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
   .plan-spec  { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
   .plan-price { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 16px; font-weight: 700; }
   .plan-price span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
   
   /* ── Form ── */
   .form-section { margin-bottom: 28px; }
   .form-section-title {
     font-size: 13px; font-weight: 600; text-transform: uppercase;
     letter-spacing: 0.8px; color: var(--text-muted);
     margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
   }
   label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
   input[type="text"], input[type="email"], input[type="password"],
   input[type="number"], select, textarea {
     width: 100%;
     background: var(--bg-card); border: 1px solid var(--border);
     border-radius: var(--radius-sm); padding: 9px 13px;
     color: var(--text); font-family: var(--font); font-size: 13.5px;
     outline: none; transition: border-color 0.15s;
   }
   input:focus, select:focus, textarea:focus {
     border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow);
   }
   textarea { resize: vertical; min-height: 90px; }
   select option { background: var(--bg-surface); }
   
   /* ── Auth / Login ── */
   .auth-page {
     min-height: 100vh; background: var(--bg);
     display: flex; align-items: center; justify-content: center; padding: 24px;
   }
   .auth-card {
     width: 100%; max-width: 400px;
     background: var(--bg-surface); border: 1px solid var(--border);
     border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
   }
   .auth-card-header {
     background: linear-gradient(135deg, #1a0000 0%, #2a0a0a 100%);
     border-bottom: 1px solid var(--border);
     padding: 32px 32px 28px; text-align: center;
   }
   .auth-card-header .logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; }
   .auth-logo-icon {
     width: 40px; height: 40px; background: var(--red); border-radius: 10px;
     display: flex; align-items: center; justify-content: center;
     font-size: 20px; font-weight: 800; color: #fff;
   }
   .auth-logo-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
   .auth-logo-name span { color: var(--red); }
   .auth-card-body { padding: 28px 32px 32px; }
   .auth-title    { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
   .auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
   .form-group    { margin-bottom: 16px; }
   .auth-divider {
     text-align: center; font-size: 12px; color: var(--text-dim);
     margin: 20px 0; position: relative;
   }
   .auth-divider::before, .auth-divider::after {
     content: ''; position: absolute; top: 50%;
     width: calc(50% - 24px); height: 1px; background: var(--border);
   }
   .auth-divider::before { left: 0; }
   .auth-divider::after  { right: 0; }
   
   /* ── Alerts ── */
   .alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid; }
   .alert-error   { background: rgba(230,48,48,0.1);  border-color: rgba(230,48,48,0.25);  color: #f87171; }
   .alert-success { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.25); color: #34d399; }
   .alert-info    { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.25); color: #60a5fa; }
   
   /* ── Utilities ── */
   .text-red    { color: var(--red); }
   .text-muted  { color: var(--text-muted); }
   .text-dim    { color: var(--text-dim); }
   .font-mono   { font-family: var(--mono); }
   .mt-16       { margin-top: 16px; }
   .mb-16       { margin-bottom: 16px; }
   .flex        { display: flex; }
   .items-center{ align-items: center; }
   .gap-8       { gap: 8px; }
   .gap-12      { gap: 12px; }
   
   /* ── Scrollbar ── */
   ::-webkit-scrollbar { width: 6px; height: 6px; }
   ::-webkit-scrollbar-track { background: transparent; }
   ::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
   ::-webkit-scrollbar-thumb:hover { background: #444; }
   
   /* ── Responsive ── */
   @media (max-width: 768px) {
     :root { --sidebar-w: 0px; }
     .sidebar { transform: translateX(-220px); transition: transform 0.25s; }
     .sidebar.open { transform: translateX(0); width: 220px; }
     .panel-main { margin-left: 0; }
     .page-content { padding: 16px; }
     .topbar { padding: 0 16px; }
     .server-grid { grid-template-columns: 1fr; }
     .plan-grid   { grid-template-columns: 1fr 1fr; }
   }
   
   /* ── Company Switcher ── */
   .company-switcher {
     padding: 10px 12px;
     border-bottom: 1px solid var(--border);
     background: var(--bg-surface);
     flex-shrink: 0;
     position: relative;
     z-index: 50;
   }
   
   .company-switcher-btn {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 8px 10px;
     border-radius: var(--radius-sm);
     cursor: pointer;
     transition: background 0.15s;
     border: 1px solid var(--border);
     background: var(--bg-card);
   }
   .company-switcher-btn:hover { background: var(--bg-hover); border-color: var(--border-light); }
   
   .company-switcher-icon {
     width: 30px; height: 30px;
     background: var(--red);
     border-radius: 6px;
     display: flex; align-items: center; justify-content: center;
     font-size: 13px; font-weight: 800; color: #fff;
     flex-shrink: 0;
   }
   
   .company-switcher-info { flex: 1; min-width: 0; }
   .company-switcher-name {
     font-size: 13px; font-weight: 600;
     white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
   }
   .company-switcher-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
   
   .company-switcher-dropdown {
     position: fixed;
     background: var(--bg-surface);
     border: 1px solid var(--border-light);
     border-radius: var(--radius-sm);
     box-shadow: 0 8px 24px rgba(0,0,0,0.5);
     z-index: 9999;
     overflow: hidden;
     min-width: 196px;
   }
   
   .company-switcher-item {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 10px 12px;
     font-size: 13px;
     color: var(--text-muted);
     cursor: pointer;
     transition: background 0.12s;
     text-decoration: none;
   }
   .company-switcher-item:hover { background: var(--bg-hover); color: var(--text); }
   .company-switcher-item.active { background: var(--red-glow); color: var(--text); }
   
   .company-item-icon {
     width: 26px; height: 26px;
     background: var(--bg-hover);
     border: 1px solid var(--border);
     border-radius: 5px;
     display: flex; align-items: center; justify-content: center;
     font-size: 12px; font-weight: 700;
     flex-shrink: 0;
   }
   .company-item-icon.personal { color: var(--text-muted); }
   .company-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
   .company-item-role { font-size: 11px; color: var(--text-muted); }
   
   .company-switcher-divider {
     height: 1px; background: var(--border); margin: 4px 0;
   }
   
   /* ── Notification Bell ── */
   .topbar-notif {
     position: relative;
     display: flex;
     align-items: center;
     justify-content: center;
     width: 34px; height: 34px;
     border-radius: var(--radius-sm);
     color: var(--text-muted);
     border: 1px solid var(--border);
     background: var(--bg-card);
     transition: background 0.15s, color 0.15s;
     text-decoration: none;
   }
   .topbar-notif:hover { background: var(--bg-hover); color: var(--text); }
   
   .notif-badge {
     position: absolute;
     top: -5px; right: -5px;
     background: var(--red);
     color: #fff;
     font-size: 9px;
     font-weight: 700;
     min-width: 16px; height: 16px;
     border-radius: 8px;
     display: flex; align-items: center; justify-content: center;
     padding: 0 3px;
   }