/* broand-cards admin — corporate dark theme (matches the cards).
 * v2 (dev-frontend polish): responsive down to 375px, inline validation
 * styles (.field-error / .invalid), focus-visible, disabled state,
 * scrollable cards table on narrow screens.
 */

* { box-sizing: border-box; }

html { background-color: black !important; height: 100%; }

body {
    margin: 0;
    padding: 0 20px 60px;
    background-color: black;
    font-family: Verdana, sans-serif;
    color: #e8e8e8;
    min-height: 100%;
    overflow-x: hidden;
    font-size: 14px;
}

a { color: #ff8080; }
a:hover { color: #ff5555; }

:focus-visible {
    outline: 2px solid rgba(255,60,60,0.7);
    outline-offset: 2px;
}

.admin-mframe {
    font-size: 30px;
    color: white;
    margin: 36px auto 6px;
    width: 100%;
    text-align: center;
}
.admin-mframe h1 {
    font-size: 30px;
    vertical-align: middle;
    font-weight: normal;
    display: inline-block;
    margin: 0;
}
.admin-mframe img {
    vertical-align: middle;
    width: 36px;
    margin: 0 10px;
}

.admin-wrap {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
}

/* topbar */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 0 14px;
    gap: 10px;
    flex-wrap: wrap;
}
.topbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9a9a9a;
    font-size: 12px;
    letter-spacing: 1px;
}

/* panels */
.panel {
    margin: 22px auto 0;
    padding: 24px 28px;
    background: rgba(10,10,12,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid #c00;
    border-radius: 8px;
}
.panel h2 {
    font-size: 16px;
    font-weight: normal;
    color: #fff;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 18px;
}

/* forms */
label {
    display: block;
    margin: 0 0 14px;
    color: #9a9a9a;
    font-size: 12px;
    letter-spacing: 1px;
}
label small { color: #666; }
input[type=text], input[type=password], input[type=url], textarea, select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #e8e8e8;
    font-family: Verdana, sans-serif;
    font-size: 14px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: rgba(255,60,60,0.6);
    box-shadow: 0 0 12px rgba(255,0,0,0.2);
}
input[type=file] { margin-top: 6px; color: #9a9a9a; }
.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
    color: #cfcfcf;
    font-size: 13px;
}
.checkline input { width: auto; margin: 0; }
.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

/* inline validation (admin.js) */
.field-error {
    color: #ff8080;
    font-size: 12px;
    letter-spacing: 0;
    margin: 6px 0 0;
}
input.invalid, textarea.invalid, select.invalid {
    border-color: rgba(255,60,60,0.75);
    box-shadow: 0 0 10px rgba(255,0,0,0.25);
}

/* buttons */
.btn {
    display: inline-block;
    padding: 9px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #e8e8e8;
    font-family: Verdana, sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.btn:hover {
    border-color: rgba(255,60,60,0.6);
    box-shadow: 0 0 14px rgba(255,0,0,0.25);
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-primary {
    background: rgba(204,0,0,0.25);
    border-color: #c00;
    color: #fff;
}
.btn-danger { border-color: rgba(255,60,60,0.5); color: #ff6b6b; }
.inline-form { display: inline; }

/* password field with generate button (user management) */
.pw-field {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.pw-field input {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}
.pw-gen {
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
}

/* banners */
.banner {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 13px;
}
.banner-error {
    background: rgba(204,0,0,0.15);
    border: 1px solid rgba(255,60,60,0.5);
    color: #ff8080;
}
.banner-ok {
    background: rgba(0,120,60,0.12);
    border: 1px solid rgba(0,200,120,0.4);
    color: #7de0b0;
}

/* login */
.login-card {
    max-width: 420px;
    margin: 60px auto;
    padding: 34px 30px;
    background: rgba(10,10,12,0.72);
    border: 1px solid rgba(204,0,0,0.35);
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(204,0,0,0.12), inset 0 0 40px rgba(0,0,0,0.5);
}
.login-card h2 {
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 18px;
    text-align: center;
}

/* auth error pages (403/404) */
.error-card {
    max-width: 460px;
    margin: 60px auto;
    padding: 34px 30px;
    background: rgba(10,10,12,0.72);
    border: 1px solid rgba(255,60,60,0.35);
    border-radius: 10px;
    text-align: center;
}
.error-code {
    font-size: 44px;
    color: #ff6b6b;
    letter-spacing: 4px;
    margin-bottom: 6px;
}
.error-card h2 {
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 10px;
}
.error-card p {
    color: #9a9a9a;
    font-size: 13px;
    margin: 0 0 22px;
}

/* cards table */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}
.cards-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: rgba(10,10,12,0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.cards-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9a9a9a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: normal;
    white-space: nowrap;
}
.cards-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    vertical-align: middle;
}
.cards-table .nowrap { white-space: nowrap; }
.empty-row td {
    text-align: center;
    color: #666;
    padding: 34px 14px;
    font-size: 13px;
}
.owner-none { color: #666; }
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 1px;
}
.tag-on { background: rgba(0,120,60,0.2); color: #7de0b0; border: 1px solid rgba(0,200,120,0.4); }
.tag-off { background: rgba(255,255,255,0.06); color: #9a9a9a; border: 1px solid rgba(255,255,255,0.15); }
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.check {
    font-size: 10px;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    color: #666;
}
.check.ok { color: #7de0b0; border-color: rgba(0,200,120,0.4); }
.check.no { color: #ff8080; border-color: rgba(255,60,60,0.4); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* list editors */
.list-editor { margin: 8px 0; }
.le-row {
    display: flex;
    gap: 8px;
    margin: 6px 0;
    align-items: center;
}
.le-row input { flex: 1; margin: 0; min-width: 0; }
.le-narrow { max-width: 70px; flex: 0 0 70px !important; }
.le-add { margin-top: 8px; }

/* section blocks */
.section-block {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px 0;
    background: rgba(255,255,255,0.02);
}
.section-block-head {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.section-block-head select { width: auto; margin: 0; }
.section-block-head input[type=text] { flex: 1; margin: 0; min-width: 160px; }
.section-block-head .checkline { margin: 0; }
.section-body { padding-left: 4px; }
.sec-skills { width: 100%; }

/* avatar preview */
.avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c00;
    margin-top: 6px;
}
.avatar-empty {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 11px;
    margin-top: 6px;
}

/* quill */
.quill-editor {
    min-height: 120px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px 6px 0 0;
    margin-top: 6px;
    color: #e8e8e8;
    font-size: 14px;
}
.quill-editor:empty::before {
    content: attr(data-placeholder);
    color: #666;
}
.ql-toolbar {
    border: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
    border-radius: 0 0 0 0;
    background: rgba(255,255,255,0.03);
    margin-top: 6px;
}
.ql-container {
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0 0 6px 6px;
    font-family: Verdana, sans-serif;
    font-size: 14px;
}
.ql-snow .ql-stroke { stroke: #cfcfcf; }
.ql-snow .ql-fill { fill: #cfcfcf; }
.ql-snow .ql-picker { color: #cfcfcf; }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active { color: #ff5555; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: #ff5555; }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: #ff5555; }
.ql-editor { min-height: 120px; color: #e8e8e8; }
.ql-editor h3 { font-size: 16px; color: #fff; }
.ql-editor h4 { font-size: 14px; color: #fff; }
.ql-editor blockquote { border-left: 3px solid #c00; margin-left: 0; padding-left: 12px; color: #b5b5b5; }
.ql-editor a { color: #ff8080; }
.ql-snow .ql-picker-options {
    background: rgba(10,10,12,0.95);
    border: 1px solid rgba(255,255,255,0.15);
}
.ql-snow .ql-picker-item { color: #cfcfcf; }
.ql-snow .ql-picker-item:hover { color: #ff5555; background: rgba(255,60,60,0.12); }
.ql-tooltip {
    background: rgba(10,10,12,0.95);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e8e8e8;
}
.ql-tooltip input[type=text] {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e8e8e8;
}
.ql-tooltip a.ql-action { border-left: 1px solid rgba(255,255,255,0.15); color: #ff8080; }

.hint { color: #666; font-size: 12px; margin: 8px 0; }

/* ---------------- responsive: mobile ---------------- */

@media (max-width: 700px) {
    body { padding: 0 12px 40px; }
    .panel { padding: 18px 16px; }
    .admin-mframe { font-size: 22px; margin-top: 24px; }
    .admin-mframe h1 { font-size: 22px; }
    .admin-mframe img { width: 26px; margin: 0 6px; }
    .login-card { padding: 26px 18px; margin: 30px auto; }
    .avatar-preview img, .avatar-empty { width: 96px; height: 96px; }
}

@media (max-width: 375px) {
    .admin-mframe { font-size: 18px; }
    .admin-mframe h1 { font-size: 18px; }
    .panel { padding: 16px 12px; }
    .le-row { flex-wrap: wrap; }
    .le-row input { flex: 1 1 100%; }
    .le-narrow { flex: 1 1 100% !important; max-width: none !important; }
    .le-row .btn { flex: 1 1 auto; padding: 7px 10px; }
    .section-block { padding: 12px 10px; }
    .section-block-head input[type=text] { flex: 1 1 100%; min-width: 0; }
    .row-actions { flex-direction: column; align-items: stretch; }
    .row-actions .btn { text-align: center; }
    .row-actions .inline-form { display: block; }
    .row-actions .pw-field { flex-wrap: wrap; }
    .row-actions .pw-field input { flex: 1 1 100%; }
    .admin-topbar { flex-direction: column; align-items: stretch; }
    .admin-topbar .btn { text-align: center; }
    .topbar-group { justify-content: center; }
    .ql-toolbar .ql-formats { flex-wrap: wrap; }
}
