:root {
    --p: #1a73e8;
    --bg: #f8f9fa;
    --card: #ffffff;
    --t: #202124;
    --t-light: #5f6368;
    --border: #dadce0;
    --g: #34a853;
    --r: #ea4335;
    --sidebar: #174ea6;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    margin: 0;
    display: flex;
    height: 100vh;
    color: var(--t);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    margin-bottom: 50px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}
.menu-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    opacity: 0.8;
}
.menu-item:hover, .menu-item.active {
    background: rgba(255,255,255,0.1);
    opacity: 1;
}
.status-box {
    margin-top: auto;
    background: rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.status-dot { width: 8px; height: 8px; background: var(--g); border-radius: 50%; box-shadow: 0 0 5px var(--g); }

/* Content Area */
.content { flex: 1; overflow-y: auto; padding: 40px; }
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.top-nav h1 { font-size: 24px; margin: 0; }
.stats-row { display: flex; gap: 20px; }
.stat-card { background: white; padding: 15px 25px; border-radius: 12px; border: 1px solid var(--border); }
.stat-card small { color: var(--t-light); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.stat-card h2 { margin: 5px 0 0; font-size: 20px; }

/* Grid & Cards */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}
.model { font-size: 18px; font-weight: 700; color: var(--sidebar); margin-bottom: 10px; }
.device-id { font-family: monospace; font-size: 11px; color: var(--t-light); }

.perm-pill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.pill {
    padding: 6px 10px;
    background: #f1f3f4;
    border-radius: 6px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pill.active { background: #e6f4ea; color: var(--g); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #999; }
.active .dot { background: var(--g); }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn {
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-main { background: var(--sidebar); color: white; }
.btn-outline { background: #f1f3f4; color: var(--t); }
.btn-danger { background: #fce8e6; color: var(--r); margin-top: 10px; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
}
.modal-window {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 800px;
    height: 80vh;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    padding: 25px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tabs { display: flex; background: #eee; border-radius: 10px; padding: 4px; margin-top: 15px; }
.tab-btn { flex: 1; border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12px; }
.tab-btn.active { background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); color: var(--sidebar); }
.log-list { flex: 1; overflow-y: auto; padding: 30px; }
.log-item { padding: 15px 0; border-bottom: 1px solid #f1f3f4; }
.log-item:last-child { border: none; }
.log-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--t-light); margin-bottom: 5px; }
.log-body { font-size: 14px; line-height: 1.6; }
.close-btn { font-size: 28px; background: none; border: none; cursor: pointer; color: var(--t-light); }
