/* ============================================================
   EURHOSTING MANAGE — Stylesheet
   ============================================================ */

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

:root {
    --green:      #7AB930;
    --green-dark: #5E9A1F;
    --blue:       #00AEEF;
    --blue-dark:  #0090C8;
    --dark:       #0D1B2A;
    --dark-2:     #1C2F44;
    --mid:        #4A6177;
    --muted:      #8A9BB0;
    --bg:         #F4F8FC;
    --card:       #FFFFFF;
    --border:     #DDE6F0;
    --red:        #EF4444;
    --red-light:  #FEE2E2;
    --yellow:     #F59E0B;
    --yellow-light: #FEF3C7;
    --green-light: #D1FAE5;

    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(13,27,42,.06);
    --shadow-md: 0 4px 16px rgba(13,27,42,.08);
    --shadow-lg: 0 12px 40px rgba(13,27,42,.12);

    --sidebar-w: 240px;
    --topbar-h:  60px;
}

html { font-size: 15px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--dark); -webkit-font-smoothing: antialiased; }
a    { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img  { max-width: 100%; display: block; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EBF5FF 0%, #F4F8FC 60%, #EDF7E5 100%);
    padding: 2rem 1rem;
}
.auth-wrap  { width: 100%; max-width: 440px; }
.auth-card  {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
}
.auth-logo  { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 36px; margin: 0 auto; }
.auth-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: .4rem; }
.auth-sub   { font-size: .88rem; color: var(--mid); text-align: center; margin-bottom: 1.8rem; }
.auth-switch { text-align: center; font-size: .84rem; color: var(--mid); margin-top: 1.2rem; }
.auth-footer { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 1.2rem; }
.auth-footer a { color: var(--muted); }

/* ── Forms ───────────────────────────────────────────────── */
.auth-form  { display: flex; flex-direction: column; gap: 1rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--dark-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.label-link { font-weight: 500; font-size: .78rem; color: var(--blue); }
.optional   { font-weight: 400; color: var(--muted); font-size: .76rem; }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
select,
textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: .65rem .9rem;
    font-size: .88rem;
    font-family: var(--font-body);
    color: var(--dark);
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,174,239,.1);
}
input.error, select.error { border-color: var(--red); }
textarea { resize: vertical; min-height: 100px; }
.form-error { font-size: .76rem; color: var(--red); }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .83rem;
    color: var(--mid);
}
.form-check input[type=checkbox] {
    width: 16px; height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: .7rem 1.4rem;
    font-size: .88rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background .15s, transform .12s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-blue    { background: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-red     { background: var(--red); }
.btn-red:hover { background: #DC2626; }
.btn-outline {
    background: transparent;
    color: var(--dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: .65rem 1.2rem;
    font-size: .86rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: border-color .15s, color .15s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm   { padding: .4rem .9rem; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost {
    background: none;
    border: none;
    color: var(--mid);
    padding: .3rem .5rem;
    cursor: pointer;
    font-size: .85rem;
    border-radius: var(--radius-sm);
    transition: background .12s, color .12s;
}
.btn-ghost:hover { background: var(--bg); color: var(--dark); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.alert-success { background: var(--green-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: var(--red-light);   color: #991B1B; border: 1px solid #FCA5A5; }
.alert-warning { background: var(--yellow-light); color: #92400E; border: 1px solid #FCD34D; }
.alert-info    { background: rgba(0,174,239,.08); color: var(--blue-dark); border: 1px solid rgba(0,174,239,.2); }

/* ── App layout (sidebar + content) ─────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: rgba(255,255,255,.75);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 1.2rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo img {
    height: 28px;
    filter: brightness(0) invert(1);
    opacity: .9;
}
.sidebar-user {
    padding: .9rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: .78rem;
}
.sidebar-user-name { font-weight: 700; color: #fff; font-size: .85rem; }
.sidebar-user-role {
    display: inline-block;
    background: rgba(0,174,239,.2);
    color: var(--blue);
    border-radius: 4px;
    padding: .1rem .4rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: .2rem;
}
.sidebar-user-role.admin { background: rgba(122,185,48,.2); color: var(--green); }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-section {
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: .75rem 1.2rem .3rem;
    margin-top: .25rem;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1.2rem;
    font-size: .84rem;
    font-weight: 500;
    color: rgba(255,255,255,.65);
    transition: background .12s, color .12s;
    border-radius: 0;
    text-decoration: none;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(0,174,239,.15); color: var(--blue); }
.sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-nav .badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    border-radius: 100px;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: .75rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
    font-size: .78rem;
    color: rgba(255,255,255,.4);
    display: flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
}
.sidebar-footer a:hover { color: rgba(255,255,255,.7); }

/* ── Main content ────────────────────────────────────────── */
.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

/* ── Page content ────────────────────────────────────────── */
.page-content { padding: 1.5rem; flex: 1; }
.page-header  {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
}
.page-header p { font-size: .84rem; color: var(--mid); margin-top: .2rem; }

/* ── Cards / Stats ───────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
}
.card-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
}
.stat-label  { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value  { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--dark); margin: .2rem 0; line-height: 1; }
.stat-change { font-size: .76rem; color: var(--mid); }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap  { overflow-x: auto; }
table        { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead tr     { border-bottom: 2px solid var(--border); }
th           { padding: .65rem .9rem; text-align: left; font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
td           { padding: .75rem .9rem; color: var(--dark-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── Badges / Status ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
}
.badge-green  { background: var(--green-light);  color: #065F46; }
.badge-blue   { background: rgba(0,174,239,.1);  color: var(--blue-dark); }
.badge-red    { background: var(--red-light);    color: #991B1B; }
.badge-yellow { background: var(--yellow-light); color: #92400E; }
.badge-gray   { background: #F1F5F9;             color: var(--mid); }

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.badge-green  .badge-dot { background: var(--green); }
.badge-blue   .badge-dot { background: var(--blue); }
.badge-red    .badge-dot { background: var(--red); }
.badge-yellow .badge-dot { background: var(--yellow); }
.badge-gray   .badge-dot { background: var(--muted); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: center;
    padding: 1rem 0;
}
.pagination a, .pagination span {
    padding: .4rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    color: var(--mid);
    transition: all .12s;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pagination .active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Search/Filter bar ───────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filter-bar input[type=text],
.filter-bar input[type=search],
.filter-bar select {
    max-width: 220px;
    font-size: .84rem;
    padding: .5rem .85rem;
}
.filter-bar .search-input { flex: 1; max-width: 300px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3   { font-size: 1rem; font-weight: 700; color: var(--dark-2); margin-bottom: .4rem; }
.empty-state p    { font-size: .85rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar    { display: none; }
    .app-main   { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row   { grid-template-columns: 1fr; }
}
