/* Harbor Client — warm professional user portal */
:root {
    --primary: #0F766E;
    --primary-glow: rgba(15, 118, 110, 0.22);
    --primary-dark: #0B5C56;
    --primary-soft: #D5F4EF;
    --secondary: #2563A8;
    --accent: #C45C26;
    --ink: #1A2332;
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    --font-display: "Fraunces", Georgia, serif;
    --bg-base: #F6F1E8;
    --bg-card: #FFFBF6;
    --bg-card-hover: #F7F1E8;
    --bg-input: #FFFDF9;
    --border: #E4D9C8;
    --border-focus: #0F766E;
    --text-white: #1A2332;
    --text-muted: #5C6B7A;
    --text-dim: #8A7F70;
    --success: #1B7F5A;
    --danger: #C23B3B;
    --warning: #B8860B;
    --info: #2563A8;
    --gradient-main: linear-gradient(135deg, #0F766E, #1A8F86);
    --gradient-card: linear-gradient(180deg, #FFFBF6, #F7F1E8);
    --shadow-glow: 0 12px 28px rgba(15, 118, 110, 0.12);
    --shadow-card: 0 10px 30px rgba(26, 35, 50, 0.07);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--ink);
    min-height: 100vh; min-height: 100dvh;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(15, 118, 110, .12), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 0%, rgba(196, 92, 38, .08), transparent 50%);
}
.page-wrapper { position: relative; z-index: 1; min-height: 100vh; }

.login-page {
    width: 100%; min-height: 100vh; min-height: 100dvh;
    display: grid; grid-template-columns: 1.05fr .95fr;
    padding: 0;
}
.login-hero {
    background: linear-gradient(160deg, #0F766E 0%, #134E4A 48%, #1A2332 100%);
    color: #F8F4EC; padding: 3rem; display: flex; flex-direction: column; justify-content: center;
}
.login-hero h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; margin: .8rem 0 .5rem; }
.login-hero p { color: rgba(248, 244, 236, .78); line-height: 1.6; max-width: 420px; }
.login-hero ol { margin-top: 1.4rem; padding-left: 1.1rem; color: #E7F6F3; font-weight: 600; line-height: 1.8; }
.login-box {
    background: transparent; border: none; box-shadow: none;
    width: 100%; max-width: 440px; margin: auto; padding: 2rem 1.5rem;
}
.login-logo { text-align: left; margin-bottom: 1.5rem; }
.login-logo .logo-icon {
    width: 52px; height: 52px; background: var(--gradient-main);
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    color: #fff; margin-bottom: .75rem;
}
.login-logo h1 { font-size: 1.45rem; font-weight: 800; color: var(--ink); background: none; -webkit-text-fill-color: unset; }
.login-logo p { color: var(--text-muted); font-size: .85rem; margin-top: .3rem; }

.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 268px; background: var(--bg-card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; z-index: 100;
    transition: transform .28s ease;
}
.sidebar-brand { padding: 1.35rem 1.25rem; }
.brand-inner { display: flex; align-items: center; gap: .75rem; }
.brand-icon {
    width: 42px; height: 42px; background: var(--gradient-main); border-radius: 13px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 8px 18px var(--primary-glow);
}
.brand-text { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.brand-sub { font-size: .68rem; color: var(--text-dim); font-weight: 600; }
.sidebar-user { padding: 0 1.1rem 1rem; }
.user-avatar-wrap { display: flex; align-items: center; gap: .7rem; background: #F4EDE2; border-radius: 14px; padding: .7rem; }
.user-avatar {
    width: 40px; height: 40px; background: var(--gradient-main); color: #fff;
    border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.user-info-side .username { font-size: .88rem; font-weight: 800; }
.user-info-side .status-badge { font-size: .68rem; color: var(--success); display: flex; align-items: center; gap: .3rem; margin-top: 2px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.sidebar-nav { flex: 1; padding: .4rem .7rem; overflow-y: auto; }
.nav-section-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim); padding: .55rem .7rem; font-weight: 700; }
.sidebar-link {
    display: flex; align-items: center; gap: .7rem; padding: .68rem .75rem;
    color: var(--text-muted); text-decoration: none; border-radius: 12px; font-size: .875rem; font-weight: 600;
}
.sidebar-link:hover { color: var(--ink); background: var(--bg-card-hover); }
.sidebar-link.active { color: var(--primary-dark); background: var(--primary-soft); }
.brand-icon svg, .logo-icon svg { width: 22px; height: 22px; }
.sidebar-link svg, .logout-btn svg, .hamburger svg, .btn svg { width: 18px; height: 18px; }
.nav-icon { width: 20px; text-align: center; }
.sidebar-footer { padding: 1rem 1rem calc(1rem + var(--safe-b)); border-top: 1px solid var(--border); }
.logout-btn {
    display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%;
    padding: .65rem 1rem; background: #FBECEC; border: 1px solid #F3C9C9; color: var(--danger);
    text-decoration: none; border-radius: var(--radius-md); font-weight: 700; font-size: .85rem;
}

.main-content { flex: 1; margin-left: 268px; padding: 1.5rem 1.75rem calc(1.75rem + var(--safe-b)); min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.page-heading h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; font-family: "Fraunces", Georgia, serif; }
.page-heading p { color: var(--text-muted); font-size: .875rem; margin-top: .2rem; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; box-shadow: var(--shadow-card); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); gap: .6rem; flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: .45rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.2rem; position: relative; overflow: hidden; box-shadow: var(--shadow-card); color: inherit;
}
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.stat-icon.purple, .stat-icon.cyan { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: #E4F5EC; color: var(--success); }
.stat-icon.red { background: #FBECEC; color: var(--danger); }
.stat-icon.yellow { background: #FBF3DC; color: var(--warning); }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .3rem; }
.stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.form-control {
    width: 100%; padding: .7rem .95rem; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); color: var(--ink); font-size: .9rem; font-family: inherit; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.form-control::placeholder { color: #B3A898; }
.form-control option { background: #fff; color: var(--ink); }
.input-group { position: relative; }
.input-group .form-control { padding-left: 2.6rem; }
.input-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.toggle-password {
    position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-dim); cursor: pointer; min-width: 36px; min-height: 36px;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .7rem 1.3rem; border-radius: var(--radius-md); font-size: .88rem; font-weight: 700;
    font-family: inherit; cursor: pointer; border: none; text-decoration: none; min-height: 42px;
}
.btn-primary { background: var(--gradient-main); color: #fff; box-shadow: var(--shadow-glow); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-success { background: #E4F5EC; border: 1px solid #BFE5D2; color: var(--success); }
.btn-danger { background: #FBECEC; border: 1px solid #F3C9C9; color: var(--danger); }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; min-height: 34px; }
.btn-full { width: 100%; }

.alert { padding: .85rem 1.1rem; border-radius: var(--radius-md); font-size: .875rem; margin-bottom: 1.1rem; display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.alert-success { background: #E4F5EC; color: var(--success); }
.alert-danger { background: #FBECEC; color: var(--danger); }
.alert-warning { background: #FBF3DC; color: var(--warning); }

.info-table { width: 100%; border-collapse: collapse; }
.info-table tr { border-bottom: 1px solid var(--border); }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: .8rem 0; font-size: .9rem; }
.info-table td:first-child { color: var(--text-muted); font-weight: 700; width: 45%; font-size: .75rem; text-transform: uppercase; }
.info-table td:last-child { color: var(--ink); font-weight: 700; text-align: right; }

.password-box { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .7rem 1rem; gap: .7rem; }
.password-value { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.copy-btn { background: var(--primary-soft); border: 1px solid #B7E6DF; color: var(--primary-dark); padding: .3rem .6rem; border-radius: 8px; cursor: pointer; font-size: .75rem; font-weight: 700; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.server-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-card); }
.server-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: .5rem; }
.server-name { font-size: 1rem; font-weight: 800; }
.server-badge { font-size: .7rem; padding: .2rem .55rem; border-radius: 99px; font-weight: 800; }
.badge { display:inline-flex; align-items:center; font-size:.72rem; font-weight:800; padding:.28rem .7rem; border-radius:99px; }
.badge-active { background: #E4F5EC; color: var(--success); }
.badge-banned, .badge-inactive { background: #FBECEC; color: var(--danger); }
.badge-warn { background: #FBF3DC; color: var(--warning); }
.server-meta { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.server-meta-item { display: flex; justify-content: space-between; font-size: .825rem; }
.server-meta-item .label { color: var(--text-muted); }
.server-meta-item .value { font-weight: 700; font-family: ui-monospace, Consolas, monospace; }

.bandwidth-label { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .35rem; color: var(--text-muted); }
.bandwidth-label .used { color: var(--primary); font-weight: 800; }
.progress-bar { height: 8px; background: #EFE6D8; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--gradient-main); }

.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab-btn { padding: .6rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 700; font-family: inherit; cursor: pointer; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.fade-in { animation: fadeSlideUp .35s ease; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }

.toast-container { position: fixed; bottom: calc(1.25rem + var(--safe-b)); right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .6rem; }
.toast { background: #1A2332; color: #F8F4EC; border-radius: 12px; padding: .85rem 1.1rem; min-width: 250px; display: flex; gap: .6rem; font-size: .85rem; }

.content-grid { display: grid; gap: 1.25rem; }
.two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: 1fr 1fr 1fr; }
.hamburger { display: none; background: #fff; border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: .4rem .6rem; cursor: pointer; min-width: 40px; min-height: 40px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(26, 35, 50, .4); z-index: 99; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.expiry-warning { background: #FBF3DC; border-radius: var(--radius-md); padding: .75rem 1rem; font-size: .825rem; color: var(--warning); display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; font-weight: 600; }
.mobile-tabbar { display: none; }
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.qa { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: .85rem; box-shadow: var(--shadow-card); }
.qa span { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 600; margin-top: .2rem; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D4C7B3; border-radius: 10px; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 1rem 1rem calc(5.2rem + var(--safe-b)); }
    .hamburger { display: inline-flex; align-items: center; justify-content: center; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .quick-row { grid-template-columns: 1fr; }
    .mobile-tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
        background: #FFFBF6; border-top: 1px solid var(--border);
        padding: .35rem .4rem calc(.35rem + var(--safe-b));
    }
    .mobile-tabbar a {
        display: flex; flex-direction: column; align-items: center; gap: .12rem;
        text-decoration: none; color: var(--text-muted); font-size: .62rem; font-weight: 700; padding: .35rem 0;
    }
    .mobile-tabbar a.active { color: var(--primary); }
    .mobile-tabbar svg { width: 20px; height: 20px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .server-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
