/*
|--------------------------------------------------------------------------
| CompanyPoint DNS-beheer
|--------------------------------------------------------------------------
| Overgenomen uit de huisstijl van het CompanyPoint Backoffice
| (backoffice.companypoint.nl/style/style.css + formulieren.css),
| aangevuld met een paar onderdelen specifiek voor DNS-beheer
| (onderaan, sectie "DNS-beheer aanvullingen").
*/

:root {
    --sidebar-width: 260px;
}

/* ---------------------------------------------------------------- algemeen */

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    font-family: "Segoe UI", sans-serif;
    color: #1f2937;
}

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 90px;
    padding: 25px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.badge-warning   { background: #fef3c7; color: #92400e; padding: 4px 8px; border-radius: 6px; }
.badge-info      { background: #dbeafe; color: #1e40af; padding: 4px 8px; border-radius: 6px; }
.badge-success   { background: #dcfce7; color: #166534; padding: 4px 8px; border-radius: 6px; }
.badge-secondary { background: #e5e7eb; color: #374151; padding: 4px 8px; border-radius: 6px; }
.badge-danger    { background: #fee2e2; color: #b91c1c; padding: 4px 8px; border-radius: 6px; }

/* ---------------------------------------------------------------- sidebar */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #1f2937;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #374151;
}

.sidebar-logo img {
    width: 125px;
    height: 125px;
    object-fit: cover;
    border-radius: 15px;
}

.logo-text {
    margin-top: 10px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.sidebar-version {
    margin-top: 15px;
    padding-bottom: 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.4;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    padding-top: 10px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid #374151;
    transition: background .2s ease;
}

.sidebar-menu a:hover { background: #374151; }

.sidebar-menu a.active {
    background: #2563eb;
    border-left: 4px solid #60a5fa;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #374151;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    box-sizing: border-box;
    color: #ffffff;
    text-decoration: none;
}

.sidebar-footer a:hover { background: #374151; }

.menu-toggle {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #374151;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
}

.menu-toggle:hover { background: rgba(255,255,255,0.08); }
.menu-toggle::after { content: "▶"; float: right; font-size: 11px; }
.menu-toggle.open::after { content: "▼"; }

.submenu { display: none; }
.submenu.open { display: block; }
.submenu a { padding-left: 40px; }

/* ---------------------------------------------------------------- topbar */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1000;
    min-height: 50px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-weight: 600;
    font-size: 22px;
    color: #1f2937;
    white-space: nowrap;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    border-radius: 8px;
}

.sidebar-toggle:hover { background: #f3f4f6; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    z-index: 1900;
}

.topbar-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.topbar-user:hover { background: #f3f4f6; }

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name { font-weight: 600; font-size: 16px; }
.user-role { font-size: 14px; color: #6b7280; }

.chevron { color: #9ca3af; transition: transform 0.15s; }
.topbar-user.open .chevron { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    min-width: 190px;
    padding: 6px;
    display: none;
    z-index: 100;
}

.user-dropdown.show { display: block; }

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
}

.user-dropdown a:hover { background: #f3f4f6; }
.user-dropdown a.logout { color: #dc2626; }
.user-dropdown hr { border: none; border-top: 1px solid #e5e7eb; margin: 6px 0; }

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------- mobiel */

@media (max-width: 900px) {
    .sidebar-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 2000;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0,0,0,.3);
    }

    .sidebar-overlay.open { display: block; }

    .topbar { left: 0; padding: 12px 16px; }

    .topbar-title {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-user { padding: 4px; gap: 0; flex-shrink: 0; }
    .topbar-user .user-details,
    .topbar-user .chevron { display: none; }

    .main-content { margin-left: 0; padding: 16px; }
}

/* ---------------------------------------------------------------- kaarten */

.card,
.detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.section-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1f2937;
}

.info-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.info-tile {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
}

.info-tile-label { font-size: 12px; color: #9ca3af; margin: 0 0 4px; }
.info-tile-value { font-size: 14px; color: #1f2937; margin: 0; overflow-wrap: anywhere; }

.actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ---------------------------------------------------------------- formulieren */

.card input[type="text"],
.card input[type="number"],
.card input[type="email"],
.card input[type="password"],
.card select,
.card textarea {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
}

.card textarea { max-width: 600px; min-height: 80px; }

.card input:focus,
.card select:focus,
.card textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.form-stack label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 500;
}

.form-stack label:first-child { margin-top: 0; }

.form-help { color: #6b7280; font-size: 13px; margin: 6px 0 0; }

.form-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.form-radio input[type="radio"] { width: 20px; height: 20px; margin: 0; }
.form-radio label { margin: 0; cursor: pointer; font-weight: normal; }

/* ---------------------------------------------------------------- knoppen */

.btn {
    display: inline-block;
    padding: 8px 12px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: .3s;
}

.btn:hover { background: #1d4ed8; }
.btn-danger { background-color: #dc3545; }
.btn-danger:hover { background-color: #bb2d3b; }
.btn-success { background-color: #198754; }
.btn-success:hover { background-color: #146c43; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
}

.btn-outline:hover { background: #f3f4f6; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-outline.danger { color: #b91c1c; }
.btn-outline.danger:hover { background: #fee2e2; }

/* ---------------------------------------------------------------- meldingen */

.alert-danger {
    background: #ffe5e5;
    color: #b00020;
    border-left: 5px solid #dc3545;
    padding: 16px;
    margin: 0 0 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
    padding: 16px;
    margin: 0 0 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 5px solid #f59e0b;
    padding: 16px;
    margin: 0 0 15px;
    border-radius: 8px;
}

/* ---------------------------------------------------------------- tabellen */

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    border: 1px solid #dddddd;
    padding: 8px;
    text-align: left;
    font-size: 14px;
}

table th { background: #f0f2f5; }
table td a:not([class]) { color: #2563eb; text-decoration: none; }
table td a:not([class]):hover { text-decoration: underline; }
table tr:nth-child(even) { background: #fafafa; }
table tr:hover { background: #f8f9fa; }

@media (max-width: 600px) {
    .col-hide-mobile { display: none; }
    .info-tiles { grid-template-columns: 1fr 1fr; }
}

.search-input {
    width: 100%;
    max-width: 700px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

.filter-btn:hover { background: #f3f4f6; }
.filter-btn.active { background: #2563eb; color: #ffffff; border-color: #2563eb; }

/* ---------------------------------------------------------------- login */

.login-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
}

.login-card {
    width: 420px;
    max-width: 90%;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,.10);
    box-sizing: border-box;
}

.login-header { text-align: center; margin-bottom: 30px; }
.login-logo { width: 160px; object-fit: contain; }

.login-title {
    margin-top: 20px;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
}

.login-form label { display: block; margin-bottom: 6px; font-weight: 500; }

.login-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 14px;
}

.login-button {
    width: 100%;
    border: 0;
    padding: 12px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
}

.login-button:hover { background: #032c9e; }

.login-version {
    margin-top: 25px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

@media (max-width: 768px) {
    .login-card { width: calc(100% - 30px); margin: 15px; padding: 20px; }
    .login-form input { font-size: 16px; }
}

/* ---------------------------------------------------------------- DNS-beheer aanvullingen */

.inline-form { display: inline; margin: 0; }

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.page-actions h3 { margin: 0; }

.muted { color: #6b7280; }
.nowrap { white-space: nowrap; }

.mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.record-type {
    display: inline-block;
    min-width: 48px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #374151;
}

.record-type.t-A, .record-type.t-AAAA { background: #dbeafe; color: #1e40af; }
.record-type.t-CNAME { background: #ede9fe; color: #5b21b6; }
.record-type.t-MX { background: #dcfce7; color: #166534; }
.record-type.t-TXT { background: #fef3c7; color: #92400e; }

.form-grid {
    display: grid;
    grid-template-columns: 120px 1fr 2fr 100px 90px auto;
    gap: 10px;
    align-items: end;
}

.form-grid label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.form-grid input,
.form-grid select { max-width: none !important; }

@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
}

/* Subpagina's in de sidebar (bv. Domeinen > Controle) */
.sidebar-menu a.sub { padding-left: 40px; font-size: 13px; color: #d1d5db; }
.sidebar-menu a.sub.active { color: #ffffff; }

/* Elementen met het attribuut "hidden" altijd verbergen,
   ook als een class (bv. .info-tiles met display:grid) iets anders zegt */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- bekijken als (zelfde als Backoffice) */

.impersonate-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 40px;
    z-index: 2100;
    background: #f59e0b;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4px 16px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
}

body.impersonating .sidebar { top: 40px; height: calc(100vh - 40px); }
body.impersonating .topbar { top: 40px; }
body.impersonating .main-content { margin-top: 130px; }

@media (max-width: 900px) {
    .impersonate-banner { font-size: 12px; }
    body.impersonating .main-content { margin-top: 150px; }
}
