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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    height: 56px;
}
.nav-brand { font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-user { font-size: 14px; color: #a0a0b0; }
.btn-logout {
    background: transparent;
    border: 1px solid #444466;
    color: #c0c0d0;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-logout:hover { background: #2a2a4e; }

/* Main content */
.main-content { padding: 40px 32px; max-width: 1100px; margin: 0 auto; }

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f5f5;
}
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: #666; font-size: 14px; margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #4a6cf7; }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.btn-primary:hover { background: #2a2a4e; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Dashboard */
.dashboard-container h2 { font-size: 22px; font-weight: 600; margin-bottom: 28px; }
.company-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin: 28px 0 12px;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.tool-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 24px 20px;
    text-decoration: none;
    color: #1a1a1a;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.tool-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #c0c0c0; }
.tool-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.tool-access {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}
.access-view { background: #eff6ff; color: #1d4ed8; }
.access-edit { background: #f0fdf4; color: #15803d; }

.no-tools { color: #888; font-size: 15px; margin-top: 16px; }


/* Company logos */
.company-header {
    margin: 28px 0 12px;
    display: flex;
    align-items: center;
}
.company-logo {
    max-height: 48px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

/* Admin */
.admin-container { max-width: 960px; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-header h2 { font-size: 22px; font-weight: 600; }

.admin-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.admin-card-padded {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 28px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    padding: 14px 20px;
    border-bottom: 2px solid #e5e5e5;
    background: #f9f9f9;
}

.admin-table td {
    padding: 14px 20px;
    vertical-align: middle;
}

.row-odd { background: #ffffff; }
.row-even { background: #f7f8fa; }

.admin-table tr:hover td { background: #eef2ff; transition: background 0.15s; }

.td-username { font-weight: 600; color: #1a1a2e; min-width: 120px; }
.td-muted { color: #555; font-size: 13px; min-width: 220px; }
.td-actions { text-align: right; min-width: 160px; padding-right: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }

.badge-admin {
    background: #ede9fe;
    color: #5b21b6;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-active {
    background: #f0fdf4;
    color: #15803d;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.badge-inactive {
    background: #f9fafb;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.btn-primary-link {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-primary-link:hover { background: #2a2a4e; }

.btn-ghost-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
}

.btn-ghost-link:hover { color: #1a1a1a; }

.btn-link {
    color: #185FA5;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #b5d4f4;
    border-radius: 6px;
    white-space: nowrap;
}

.btn-link:hover { background: #e6f1fb; }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus { outline: none; border-color: #4a6cf7; }

.form-group-check { margin-bottom: 24px; }

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.check-label input[type="checkbox"] { width: 16px; height: 16px; }

.form-actions { margin-top: 24px; }

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Permissions page */
.perm-company-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin: 24px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e5e5;
}

.perm-tool-list { margin-bottom: 8px; }

.perm-tool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.perm-tool-row:last-child { border-bottom: none; }
.perm-tool-name { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.perm-options { display: flex; gap: 28px; }

.perm-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.perm-radio input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: #1a1a2e;
    cursor: pointer;
}

.nav-admin-link {
    color: #a0a0b0;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid #444466;
    border-radius: 5px;
}

.nav-admin-link:hover { background: #2a2a4e; color: #fff; }