@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   EcoTools Admin – House Style
   Teal-Blue (#2A4E6C) + White + Orange Accent (#FF5000)
   Matches the TV dashboard visual identity
   ============================================================ */

:root {
    --brand: #2A4E6C;
    --bg: #294a60;
    --bg-dark: #1e3a4f;
    --bg-darker: #162d3e;
    --accent: #FF5000;
    --accent-hover: #e64800;
    --accent-glow: rgba(255, 80, 0, 0.2);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.45);
    --outline: rgba(255, 255, 255, 0.18);
    --outline-hover: rgba(255, 255, 255, 0.3);
    --panel: rgba(255, 255, 255, 0.06);
    --panel-hover: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.15);
    --good: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --info: #3b82f6;
    --radius: 14px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ===================== HEADER ===================== */
.premium-header {
    background: var(--bg-darker);
    border-bottom: 2px solid var(--outline);
    padding: 0 24px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-logo {
    font-weight: 900;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-logo svg { flex-shrink: 0; }
.brand-logo span { color: var(--accent); font-weight: 800; }

.nav-links { display: flex; gap: 2px; }
.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all var(--transition);
}
.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}
.nav-links a.active {
    color: #fff;
    background: var(--accent);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.user-name {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-name::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--good);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--outline);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===================== FOOTER ===================== */
.premium-footer {
    border-top: 1px solid var(--outline);
    padding: 1rem 2rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: auto;
}

/* ===================== CONTAINER ===================== */
.premium-container {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .icon { display: flex; align-items: center; }

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 3px 0 0 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }

/* ===================== GLASS PANELS ===================== */
.glass-panel {
    background: var(--panel);
    border: 2px solid var(--outline);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--outline);
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.panel-title .accent-bar {
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input,
.form-select,
textarea.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--outline);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
textarea.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-dim); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
}
.form-check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--outline);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
    border-color: var(--outline-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* ===================== TABLES ===================== */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    text-align: left;
    color: var(--text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--outline);
}

.premium-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    vertical-align: middle;
}

.premium-table tbody tr {
    transition: background var(--transition);
}
.premium-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ===================== BADGES ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--good); border: 1px solid rgba(34, 197, 94, 0.25); }
.badge-success::before { background: var(--good); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-danger::before { background: var(--bad); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-warning::before { background: var(--warn); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-info::before { background: var(--info); }

/* ===================== ALERTS ===================== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.2); }
.alert-error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }

/* ===================== PORTAL CARDS ===================== */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.portal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1rem;
    background: var(--panel);
    border: 2px solid var(--outline);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    cursor: pointer;
}

.portal-card:hover {
    border-color: var(--accent);
    background: var(--panel-hover);
    color: var(--text);
    transform: translateY(-2px);
}

.portal-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all var(--transition);
}
.portal-icon svg { width: 22px; height: 22px; }

.portal-card:hover .portal-icon {
    background: var(--accent-glow);
}

.portal-label {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.portal-desc {
    color: var(--text-dim);
    font-size: 0.75rem;
}

/* ===================== IMAGE PREVIEW ===================== */
.img-preview {
    max-width: 90px;
    max-height: 55px;
    border-radius: 6px;
    border: 1px solid var(--outline);
    object-fit: cover;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-dim);
}
.empty-state svg { margin-bottom: 0.75rem; opacity: 0.4; }

/* ===================== ACTIONS ROW ===================== */
.actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .premium-header { flex-direction: column; height: auto; padding: 10px 1rem; gap: 6px; }
    .nav-links { flex-wrap: wrap; }
    .premium-container { padding: 1rem; }
    .portal-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
