/* ПрофиДей Admin — Super-admin panel styles */
:root {
    --bg: #ffffff;
    --fg: #1d1d1f;
    --fg-secondary: #86868b;
    --fg-tertiary: #aeaeb2;
    --border: #d2d2d7;
    --accent: #ff3b30;
    --accent-hover: #e0352b;
    --bg-secondary: #fbfbfd;
    --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
/* Override Bootstrap focus rings globally */
input:focus, select:focus, textarea:focus, button:focus {
    outline: none !important;
    box-shadow: none !important;
}
body {
    background: var(--bg-secondary);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    line-height: 1.5;
    margin: 0;
}

/* Navbar */
.pd-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    height: 52px;
}
.pd-nav-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
    gap: 12px;
}
.pd-logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.pd-logo:hover { color: var(--fg); }
.pd-admin-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    border-radius: 980px;
    letter-spacing: 0.03em;
}
.pd-nav-spacer { flex: 1; }
.pd-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pd-nav-user {
    font-size: 13px;
    color: var(--fg-secondary);
}
.pd-nav-logout {
    font-size: 13px;
    color: var(--fg-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: 980px;
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.pd-nav-logout:hover { color: var(--accent); border-color: var(--accent); }

/* Layout */
.pd-layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

/* Sidebar */
.pd-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
}
.pd-sidebar-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 12px 6px;
}
.pd-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--fg);
    text-decoration: none;
    transition: background 0.12s;
    font-weight: 450;
}
.pd-sidebar-link:hover { background: #f5f5f7; color: var(--fg); }
.pd-sidebar-link.active {
    background: #f0f0f5;
    font-weight: 550;
}
.pd-sidebar-link .pd-sidebar-icon { font-size: 17px; width: 24px; text-align: center; }

/* Main content */
.pd-main {
    flex: 1;
    padding: 28px 32px;
    max-width: 100%;
    overflow-x: auto;
}

/* Cards */
.pd-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.pd-card-header {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pd-card-body {
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pd-card-body.pd-no-pad {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Filter bar */
.pd-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.pd-filter-bar input[type="text"],
.pd-filter-bar input[type="search"] {
    flex: 1;
    min-width: 180px;
    padding: 9px 16px;
    font-size: 14px;
    border: none;
    border-radius: 980px;
    background: var(--bg-secondary);
    color: var(--fg);
    outline: none;
    font-family: inherit;
    transition: background 0.15s, box-shadow 0.15s;
}
.pd-filter-bar input:focus {
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}
.pd-filter-bar .pd-select {
    padding: 9px 36px 9px 16px;
    font-size: 14px;
    border: none;
    border-radius: 980px;
    background: var(--bg-secondary);
    color: var(--fg);
    outline: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: background 0.15s, box-shadow 0.15s;
}
.pd-filter-bar .pd-select:focus {
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}
.pd-filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

/* Tables */
.pd-table {
    width: 100%;
    border-collapse: collapse;
}
.pd-table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 20px;
    text-align: left;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.pd-table tbody td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f3;
    vertical-align: middle;
}
.pd-table tbody tr:last-child td { border-bottom: none; }
.pd-table tbody tr:hover td { background: #fafafc; }
.pd-table .pd-td-accent {
    font-weight: 500;
    color: var(--accent);
}

/* Buttons */
.pd-btn-full { width: 100%; }

.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    line-height: 1;
    font-family: inherit;
    white-space: normal;
    word-break: keep-all;
    flex-shrink: 0;
}
.pd-btn-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pd-btn-primary {
    background: var(--accent);
    color: #fff;
}
.pd-btn-primary:hover { background: var(--accent-hover); color: #fff; }
.pd-btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.pd-btn-outline:hover { background: var(--accent); color: #fff; }
.pd-btn-ghost {
    background: transparent;
    color: var(--fg-secondary);
    border: 1px solid var(--border);
}
.pd-btn-ghost:hover { background: #f5f5f7; color: var(--fg); }
.pd-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}
.pd-btn-xs {
    padding: 5px 10px;
    font-size: 15px;
    border-radius: 980px;
    line-height: 1.2;
    min-width: 32px;
}

/* Badges */
.pd-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.pd-badge-success { background: #e8f5e9; color: #248a3d; }
.pd-badge-danger { background: #fff0f0; color: #c5281e; }
.pd-badge-warning { background: #fff8e1; color: #8b6914; }
.pd-badge-info { background: #e3f2fd; color: #1a6fc4; }
.pd-badge-secondary { background: #f5f5f7; color: #6e6e73; }

/* Forms */
.pd-field { margin-bottom: 10px; }
.pd-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pd-field input[type="text"],
.pd-field input[type="password"],
.pd-field input[type="email"],
.pd-field input[type="number"],
.pd-field select,
.pd-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.pd-field input:focus,
.pd-field select:focus,
.pd-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}
.pd-renew-date {
    padding: 9px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 980px;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    font-family: inherit;
    cursor: pointer;
    width: auto;
}
.pd-renew-date:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}
.pd-field .pd-error {
    font-size: 13px;
    color: var(--accent);
    margin-top: 4px;
}
.pd-field .pd-hint {
    font-size: 12px;
    color: var(--fg-tertiary);
    margin-top: 4px;
}

/* Form grid */
.pd-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Search bar */
.pd-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.pd-search-row input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 980px;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.pd-search-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}

/* Select in row */
.pd-select {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 980px;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

/* Top bar */
.pd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.pd-topbar h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}
.pd-topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Pagination */
.pd-pager {
    display: flex;
    gap: 4px;
    padding: 20px 24px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
.pd-pager a,
.pd-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--fg-secondary);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.pd-pager a:hover {
    background: #f0f0f5;
    color: var(--fg);
    border-color: var(--border);
}
.pd-pager .active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}
.pd-pager .disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Alerts */
.pd-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.4;
}
.pd-alert-success { background: #f0fff4; color: #248a3d; }
.pd-alert-error { background: #fff2f0; color: #c5281e; }

/* Breadcrumbs */
.pd-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--fg-tertiary);
    flex-wrap: wrap;
}
.pd-breadcrumbs a {
    color: var(--fg-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.pd-breadcrumbs a:hover { color: var(--accent); }
.pd-breadcrumbs .pd-breadcrumb-sep {
    color: var(--fg-tertiary);
    font-size: 11px;
    user-select: none;
}
.pd-breadcrumbs .pd-breadcrumb-current {
    color: var(--fg);
    font-weight: 450;
}

/* Section title */
.pd-section-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
}

/* Stat cards row */
.pd-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.pd-stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.pd-stat-card .pd-stat-label {
    font-size: 12px;
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.pd-stat-card .pd-stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
}

/* Simple table (non-GridView) */
.pd-info-table { width: 100%; border-collapse: collapse; }
.pd-info-table th, .pd-info-table td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.pd-info-table th {
    width: 180px;
    font-weight: 500;
    color: var(--fg-secondary);
    font-size: 13px;
}
.pd-info-table tr:last-child th, .pd-info-table tr:last-child td { border-bottom: none; }

/* Hamburger */
.pd-burger {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--fg);
    font-size: 22px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.pd-burger:hover { background: #f5f5f7; }

/* Sidebar overlay for mobile */
.pd-sidebar-overlay {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

/* Responsive */
/* Auth page */
.pd-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.pd-auth-card {
    width: 400px;
    max-width: 90vw;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
}
.pd-auth-card .pd-auth-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 0 0 8px;
}
.pd-auth-card .pd-auth-subtitle {
    font-size: 14px;
    color: var(--fg-secondary);
    text-align: center;
    margin: 0 0 28px;
}
.pd-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.pd-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.pd-check label {
    font-size: 14px;
    color: var(--fg-secondary);
}

/* Error page */
.pd-error-body { text-align: center; padding: 60px 40px; }
.pd-error-icon { font-size: 48px; margin-bottom: 16px; }
.pd-error-title { font-size: 24px; font-weight: 700; margin: 0 0 12px; }
.pd-error-message { font-size: 15px; color: var(--fg-secondary); margin: 0; line-height: 1.5; }

/* Horizontal divider */
.pd-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.pd-divider--mt { margin-top: 32px; }

/* Settings page */
.pd-settings-form { max-width: 400px; }
.pd-settings-info { font-size: 13px; color: var(--fg-secondary); line-height: 1.7; }
.pd-settings-info p { margin: 0 0 8px; }
.pd-settings-info p:last-child { margin: 0; }
.pd-settings-info strong { color: var(--fg); }

/* Contacts page link block */
.pd-contacts-link { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pd-contacts-link-code { background: var(--bg-secondary); padding: 8px 16px; border-radius: var(--radius); font-size: 14px; word-break: break-all; }

/* Table modifiers */
.pd-table-mono { font-size: 13px; color: var(--fg-tertiary); font-family: SF Mono, monospace; }
.pd-table-actions { text-align: right; white-space: nowrap; }
.pd-td-muted { font-size: 13px; color: var(--fg-tertiary); white-space: nowrap; }
.pd-table-actions .pd-btn { padding: 6px 9px; font-size: 16px; }

/* Accent link */
.pd-link-accent { color: var(--accent); text-decoration: none; font-weight: 500; }
.pd-link-accent:hover { color: var(--accent); }

/* Empty state */
.pd-empty-body { text-align: center; color: var(--fg-tertiary); padding: 40px; }

/* Filter bar in card header */
.pd-card-header .pd-filter-bar { margin-left: auto; }
.pd-filter-bar--sm { flex: 1; max-width: 400px; }

/* Nav logout form */
.pd-nav-logout-form { margin: 0; }

/* Renew form */
.pd-renew-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 768px) {
    .pd-burger { display: flex; }
    .pd-main { padding: 20px 16px; }
    .pd-topbar { flex-direction: column; align-items: flex-start; }
    .pd-topbar h2 { font-size: 24px; }
    .pd-search-row { flex-direction: column; }
    .pd-nav-user { display: none; }
    .pd-nav-inner { padding: 0 16px; }
    .pd-info-table th { width: 120px; }
    .pd-table { min-width: 600px; }
    .pd-table thead th { padding: 12px 14px; }
    .pd-table tbody td { padding: 14px 14px; }
    .pd-btn { font-size: 13px; padding: 8px 16px; }
    .pd-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    .pd-filter-bar {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
    }
    .pd-filter-bar input[type="text"],
    .pd-filter-bar input[type="search"] { min-width: 0; flex: 1; width: 100%; }
    .pd-filter-bar .pd-select { flex: 1; min-width: 0; }
    .pd-filter-bar .pd-btn { flex-shrink: 0; padding: 6px 10px; font-size: 14px; }
    .pd-filter-divider { display: none; }
    .pd-form-grid { grid-template-columns: 1fr !important; }
    .pd-renew-date { width: auto; flex: 1; min-width: 0; }

    .pd-sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        width: 240px;
    }
    .pd-sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 24px rgba(0,0,0,0.15);
    }
    .pd-sidebar-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Channels list (contacts page) */
.pd-channels-list {
    padding-left: 20px;
    margin: 0;
    font-size: 13px;
    color: var(--fg-secondary);
    line-height: 1.7;
}
.pd-channels-list a {
    color: var(--accent);
    text-decoration: none;
}
.pd-channels-list a:hover { text-decoration: underline; }
