/* ClinicOctane Theme — 1.0.0 */

:root {
    --co-primary:      #2563eb;
    --co-primary-dark:  #1d4ed8;
    --co-primary-light: #eff6ff;
    --co-text:          #111827;
    --co-text-muted:    #6b7280;
    --co-bg:            #f9fafb;
    --co-white:         #ffffff;
    --co-border:        #e5e7eb;
    --co-success:       #16a34a;
    --co-danger:        #dc2626;
    --co-radius:        8px;
    --co-shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --co-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--co-font);
    color: var(--co-text);
    background: var(--co-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────── */
.co-header {
    background: var(--co-white);
    border-bottom: 1px solid var(--co-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--co-shadow);
}
.co-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.co-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--co-text);
}
.co-header-logo {
    height: 36px;
    width: auto;
}
.co-header-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ── Navigation ───────────────────────────────────────────── */
.co-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.co-nav-list {
    list-style: none;
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
}
.co-nav-list li a,
.co-nav-link {
    display: inline-block;
    padding: 8px 14px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--co-text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all .15s;
}
.co-nav-list li a:hover,
.co-nav-link:hover {
    color: var(--co-text);
    background: var(--co-bg);
}
.co-nav-list li.current-menu-item a,
.co-nav-list li.current_page_item a {
    color: var(--co-primary);
    background: var(--co-primary-light);
}
.co-nav-login {
    color: var(--co-white) !important;
    background: var(--co-primary) !important;
    border-radius: 6px;
    font-weight: 600;
}
.co-nav-login:hover {
    background: var(--co-primary-dark) !important;
    color: var(--co-white) !important;
}
.co-nav-logout {
    color: var(--co-text-muted) !important;
    font-size: .82rem !important;
}

/* ── Avatar Dropdown ──────────────────────────────────────── */
.co-avatar-wrap {
    position: relative;
    margin-left: 8px;
}
.co-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--co-primary);
    color: var(--co-white);
    font-size: .82rem;
    font-weight: 700;
    font-family: var(--co-font);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    transition: box-shadow .15s;
}
.co-avatar:hover, .co-avatar:focus {
    box-shadow: 0 0 0 3px var(--co-primary-light);
    outline: none;
}
.co-avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 240px;
    background: var(--co-white);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 200;
    overflow: hidden;
}
.co-avatar-wrap.open .co-avatar-dropdown {
    display: block;
}
.co-avatar-header {
    padding: 14px 16px 10px;
}
.co-avatar-name {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--co-text);
}
.co-avatar-email {
    display: block;
    font-size: .8rem;
    color: var(--co-text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-avatar-divider {
    height: 1px;
    background: var(--co-border);
}
a.co-avatar-item {
    display: block;
    padding: 10px 16px;
    font-size: .88rem;
    color: var(--co-text);
    text-decoration: none;
    transition: background .1s;
}
a.co-avatar-item:hover {
    background: var(--co-bg);
}
a.co-avatar-signout {
    color: var(--co-danger);
}

/* ── Main Content ─────────────────────────────────────────── */
.co-main {
    min-height: calc(100vh - 120px);
}
.co-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Module Sub-Navigation ────────────────────────────────── */
.co-module-nav {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid var(--co-border, #e5e7eb);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.co-module-nav-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--co-text, #111827);
    padding: 8px 16px 8px 0;
    margin-right: 8px;
    border-right: 1px solid var(--co-border, #e5e7eb);
    white-space: nowrap;
}
.co-module-nav-tabs { display: flex; gap: 0; align-items: stretch; }
.co-module-tab {
    padding: 8px 14px;
    text-decoration: none;
    color: var(--co-text-muted, #6b7280);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    border-right: 1px solid var(--co-border, #e5e7eb);
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
}
.co-module-tab:last-child { border-right: none; }
.co-module-tab:hover { color: var(--co-primary, #2563eb); border-bottom-color: #ccc; }
.co-module-tab-active {
    color: var(--co-primary, #2563eb);
    border-bottom-color: var(--co-primary, #2563eb);
    font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────── */
.co-footer {
    background: var(--co-white);
    border-top: 1px solid var(--co-border);
    padding: 16px 0;
}
.co-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    font-size: .82rem;
    color: var(--co-text-muted);
}

/* ── Buttons ──────────────────────────────────────────────── */
.co-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--co-radius);
    font-family: var(--co-font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .15s;
}
.co-btn-primary {
    background: var(--co-primary);
    color: var(--co-white);
}
.co-btn-primary:hover {
    background: var(--co-primary-dark);
    color: var(--co-white);
}
.co-btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

/* ── Welcome Page ─────────────────────────────────────────── */
.co-welcome-public {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}
.co-welcome-hero {
    text-align: center;
    max-width: 480px;
}
.co-welcome-logo {
    height: 64px;
    width: auto;
    margin-bottom: 24px;
}
.co-welcome-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.co-welcome-hero p {
    color: var(--co-text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

/* Logged-in welcome dashboard */
.co-welcome h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
}
.co-welcome-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.co-welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 20px;
    background: var(--co-white);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow);
    text-decoration: none;
    color: var(--co-text);
    transition: all .15s;
}
.co-welcome-card:hover {
    border-color: var(--co-primary);
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
    transform: translateY(-2px);
}
.co-welcome-icon {
    font-size: 2rem;
}
.co-welcome-label {
    font-weight: 600;
    font-size: .95rem;
}

/* ── My Profile Form ─────────────────────────────────────── */
.co-profile-form h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
}
.co-profile-section {
    background: var(--co-white);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    padding: 24px;
    margin-bottom: 20px;
}
.co-profile-section h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.co-profile-section-desc {
    color: var(--co-text-muted);
    font-size: .88rem;
    margin: -8px 0 16px;
}
.co-profile-form .co-portal-form-table {
    width: 100%;
    border-collapse: collapse;
}
.co-profile-form .co-portal-form-table th {
    text-align: left;
    padding: 10px 16px 10px 0;
    font-weight: 500;
    font-size: .88rem;
    color: var(--co-text-muted);
    width: 140px;
    vertical-align: top;
    padding-top: 14px;
}
.co-profile-form .co-portal-form-table td {
    padding: 8px 0;
}
.co-profile-form input[type="text"],
.co-profile-form input[type="tel"],
.co-profile-form input[type="email"] {
    width: 100%;
    max-width: 360px;
    padding: 10px 12px;
    border: 1px solid var(--co-border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--co-font);
    transition: border-color .15s;
}
.co-profile-form input:focus {
    border-color: var(--co-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.co-profile-readonly {
    display: inline-block;
    padding: 10px 0;
    font-size: .9rem;
    color: var(--co-text);
}
.co-portal-field-note {
    display: block;
    font-size: .8rem;
    color: var(--co-text-muted);
    margin-top: 4px;
}
.co-profile-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.co-profile-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--co-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s;
}
.co-profile-radio:hover {
    border-color: var(--co-primary);
}
.co-profile-radio input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--co-primary);
}
.co-profile-radio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.co-profile-radio-label strong {
    font-size: .9rem;
}
.co-profile-radio-label span:last-child {
    font-size: .8rem;
    color: var(--co-text-muted);
}
.co-profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}
.co-btn-secondary {
    background: var(--co-white);
    color: var(--co-text-muted);
    border: 1px solid var(--co-border);
}
.co-btn-secondary:hover {
    background: var(--co-bg);
    color: var(--co-text);
}
.co-portal-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: .9rem;
    margin-bottom: 16px;
}
.co-portal-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.co-portal-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .co-header-inner { padding: 0 16px; }
    .co-header-name { display: none; }
    .co-nav-list { gap: 0; }
    .co-nav-list li a, .co-nav-link { padding: 6px 10px; font-size: .82rem; }
    .co-content { padding: 16px; }
    .co-welcome-links { grid-template-columns: 1fr 1fr; }
    .co-profile-form .co-portal-form-table th { display: block; width: auto; padding-bottom: 2px; padding-top: 8px; }
    .co-profile-form .co-portal-form-table td { display: block; padding-top: 0; }
    .co-profile-form input[type="text"],
    .co-profile-form input[type="tel"] { max-width: 100%; }
}

/* ── WordPress admin bar offset ───────────────────────────── */
.admin-bar .co-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .co-header { top: 46px; } }

/* ── Hide menu items with require-* classes from CSS (backup) */
.menu-item.require-login,
.menu-item.require-co_staff,
.menu-item.require-co_practice_admin,
.menu-item.require-co_super_admin,
.menu-item.logged-out-only {
    /* Visibility handled in PHP filter; CSS backup just in case */
}
