/* =========================================================
   APP SHELL — authenticated pages (dashboard/iris/email/roster/application)
   ========================================================= */
.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 56px);
}

.app-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e4e8;
    padding: 20px 14px;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.app-sidebar-section {
    margin-bottom: 18px;
}

.app-sidebar-label {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #aaa;
    padding: 0 10px;
    margin-bottom: 6px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    margin-bottom: 2px;
    transition: all .12s;
}

.app-nav-item svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }

.app-nav-item:hover { background: #f0f1ff; color: #3d47c9; }

.app-nav-item.active {
    background: #e8eaff;
    color: #3d47c9;
    font-weight: 700;
}

.app-nav-badge {
    margin-left: auto;
    background: #3d47c9;
    color: #fff;
    border-radius: 10px;
    font-size: .64rem;
    font-weight: 700;
    padding: 1px 6px;
}

.app-content {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 60px;
}

.app-content-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.app-title { font-size: 1.4rem; font-weight: 700; color: #111; margin-bottom: 4px; }
.app-subtitle { font-size: .84rem; color: #888; }

.app-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* user menu in topbar */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: 20px;
    border: 1px solid #e2e4e8;
    cursor: pointer;
    background: #fff;
}

.user-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #3d47c9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
}

.user-chip-name { font-size: .8rem; font-weight: 500; color: #333; }

/* =========================================================
   CARDS (dashboard building blocks — same visual language as
   .mock-quicklinks / .mock-announce from the marketing shots)
   ========================================================= */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #eceef3;
}

.card-title {
    font-size: .86rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title a, .card-title button.link-btn {
    font-size: .72rem;
    font-weight: 500;
    color: #3d47c9;
    background: none;
    border: none;
    cursor: pointer;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

.dash-quick-item {
    border: 1px solid #e2e4e8;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all .15s;
}
.dash-quick-item:hover { border-color: #3d47c9; color: #3d47c9; background: #f0f1ff; }

.dash-quick-icon {
    width: 24px; height: 24px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-quick-icon svg { width: 13px; height: 13px; fill: currentColor; }

/* profile summary card */
.profile-banner { background: linear-gradient(135deg,#1e2257,#3d47c9); height: 64px; border-radius: 8px 8px 0 0; }
.profile-body { background: #fff; border: 1px solid #eceef3; border-top: none; border-radius: 0 0 8px 8px; padding: 0 18px 18px; }
.profile-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: #3d47c9; border: 3px solid #fff;
    margin-top: -28px; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 700; color: #fff;
}
.profile-name { font-size: .98rem; font-weight: 700; color: #111; }
.profile-role { font-size: .78rem; color: #3d47c9; margin-bottom: 12px; }
.profile-field-row { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid #f0f1f5; }
.profile-field-label { font-size: .68rem; font-weight: 600; color: #aaa; letter-spacing: .06em; text-transform: uppercase; }
.profile-field-val { font-size: .78rem; color: #333; font-weight: 500; }
.profile-field-val.green { color: #2e7d32; }

/* =========================================================
   BADGES / TAGS
   ========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .66rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.badge-blue { background: #e8eaff; color: #3d47c9; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-red { background: #fdecea; color: #c62828; }
.badge-amber { background: #fff8e1; color: #f57f17; }
.badge-gray { background: #f0f1f5; color: #888; }
.badge-purple { background: #f3e5f5; color: #7b1fa2; }
.badge-discord { background: #eef0fd; color: #5865F2; }

/* =========================================================
   FORMS (login / register / application / iris modals)
   ========================================================= */
.auth-wrap {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: #f0f2f5;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e4e8;
    box-shadow: 0 4px 24px rgba(20,25,60,.06);
    padding: 34px 32px;
}

.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .logo-badge { margin: 0 auto 14px; }
.auth-title { font-size: 1.25rem; font-weight: 700; color: #111; margin-bottom: 6px; }
.auth-sub { font-size: .82rem; color: #888; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e8eaef; }
.auth-divider span { font-size: .7rem; color: #aaa; text-transform: uppercase; letter-spacing: .06em; }

.auth-foot { text-align: center; margin-top: 20px; font-size: .82rem; color: #888; }
.auth-foot a { color: #3d47c9; font-weight: 500; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .76rem; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-hint { font-size: .72rem; color: #999; margin-top: 5px; }
.form-error-text { font-size: .72rem; color: #c62828; margin-top: 5px; display: none; }
.form-group.error .form-error-text { display: block; }
.form-group.error .form-input, .form-group.error .form-select, .form-group.error textarea.form-input { border-color: #e57373; }

.form-input, .form-select, textarea.form-input {
    width: 100%;
    border: 1px solid #d8dbe3;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: .86rem;
    color: #212529;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, textarea.form-input:focus {
    outline: none;
    border-color: #3d47c9;
    box-shadow: 0 0 0 3px rgba(61,71,201,.12);
}
textarea.form-input { resize: vertical; min-height: 90px; }

.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.form-check { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: #555; }
.form-link { font-size: .8rem; color: #3d47c9; font-weight: 500; cursor: pointer; background: none; border: none; }

.btn-block { width: 100%; justify-content: center; }
.btn-secondary {
    background: #fff; color: #3d47c9; border: 1px solid #d8dbe3;
    border-radius: 5px; padding: 10px 20px; font-size: .86rem; font-weight: 500;
    font-family: 'Roboto',sans-serif; cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { border-color: #3d47c9; background: #f7f8ff; }
.btn-danger {
    background: #fdecea; color: #c62828; border: 1px solid #f5c6c2;
    border-radius: 5px; padding: 10px 20px; font-size: .86rem; font-weight: 500;
    font-family: 'Roboto',sans-serif; cursor: pointer; transition: all .15s;
}
.btn-danger:hover { background: #fadbd8; }
.btn-sm { padding: 6px 12px; font-size: .76rem; }

/* =========================================================
   TABLES (roster / iris / applications)
   ========================================================= */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th {
    text-align: left; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #999; padding: 10px 14px; border-bottom: 1px solid #eceef3;
    background: #fafbfd; white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f2f3f7; color: #333; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbff; }

.table-avatar-cell { display: flex; align-items: center; gap: 10px; }
.table-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: #3d47c9; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; flex-shrink: 0;
}
.table-name { font-weight: 600; color: #111; }
.table-sub { font-size: .72rem; color: #999; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .form-input, .toolbar .form-select { width: auto; min-width: 160px; }
.toolbar-search { flex: 1; min-width: 200px; }

/* =========================================================
   STATES — loading skeleton / empty / error
   ========================================================= */
.skeleton {
    background: linear-gradient(90deg,#eef0f5 25%,#f6f7fa 37%,#eef0f5 63%);
    background-size: 400% 100%;
    animation: skeleton-shine 1.4s ease infinite;
    border-radius: 5px;
}
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-row { height: 42px; margin-bottom: 6px; border-radius: 6px; }

.empty-state { text-align: center; padding: 48px 20px; color: #aaa; }
.empty-state svg { width: 38px; height: 38px; fill: #ddd; margin: 0 auto 12px; }
.empty-state-title { font-size: .88rem; font-weight: 600; color: #888; margin-bottom: 4px; }
.empty-state-desc { font-size: .78rem; color: #bbb; max-width: 320px; margin: 0 auto; }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 6px; font-size: .82rem; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: #fdecea; color: #c62828; border-color: #f5c6c2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-color: #b9dfba; }
.alert-info { background: #e8eaff; color: #3d47c9; border-color: #cfd4f7; }

/* access denied */
.denied-wrap {
    min-height: calc(100vh - 56px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px;
}
.denied-icon {
    width: 60px; height: 60px; border-radius: 50%; background: #fdecea; color: #c62828;
    display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.denied-icon svg { width: 26px; height: 26px; fill: currentColor; }

/* modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,24,50,.45);
    display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; width: 100%; max-width: 460px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #eceef3; }
.modal-title { font-size: .96rem; font-weight: 700; color: #111; }
.modal-close { background: none; border: none; cursor: pointer; color: #999; font-size: 1.1rem; line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid #eceef3; }

/* email / roster split panels reused from marketing mock */
.split-panel { display: grid; grid-template-columns: 260px 1fr; min-height: 480px; }
.panel-divider { border-right: 1px solid #f0f1f5; }

/* IRIS management grid tiles */
.manage-tile {
    background: #fff; border: 1px solid #eceef3; border-radius: 8px; padding: 16px;
    cursor: pointer; transition: all .15s;
}
.manage-tile:hover { border-color: #3d47c9; box-shadow: 0 4px 14px rgba(61,71,201,.1); }
.manage-tile-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.manage-tile-icon svg { width: 17px; height: 17px; fill: currentColor; }
.manage-tile-title { font-size: .86rem; font-weight: 700; color: #111; margin-bottom: 3px; }
.manage-tile-desc { font-size: .76rem; color: #888; line-height: 1.5; }
.manage-tile-count { font-size: .68rem; color: #3d47c9; font-weight: 700; margin-top: 8px; }

/* email client component classes */
.email-compose-btn {
    background: #3d47c9; color: #fff; border: none; border-radius: 5px; padding: 8px 14px;
    font-size: .75rem; font-weight: 500; font-family: 'Roboto',sans-serif; cursor: pointer;
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 12px;
}
.email-nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; font-size: .78rem; color: #555; cursor: pointer; margin-bottom: 2px; }
.email-nav-item.active { background: #e8eaff; color: #3d47c9; font-weight: 500; }
.email-nav-item svg { width: 13px; height: 13px; fill: currentColor; }
.email-nav-badge { margin-left: auto; background: #3d47c9; color: #fff; border-radius: 10px; font-size: .65rem; font-weight: 700; padding: 1px 6px; }
.email-address-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f1f5; }
.email-address-label { font-size: .65rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #aaa; margin-bottom: 6px; }
.email-address { font-size: .72rem; color: #3d47c9; margin-bottom: 4px; }
.email-item { padding: 10px 14px; border-bottom: 1px solid #f8f8f8; cursor: pointer; transition: background .12s; }
.email-item:hover { background: #fafbff; }
.email-item-header { display: flex; justify-content: space-between; margin-bottom: 3px; }
.email-from { font-size: .78rem; font-weight: 600; color: #111; }
.email-time { font-size: .7rem; color: #aaa; }
.email-subject { font-size: .78rem; color: #333; margin-bottom: 2px; }
.email-preview { font-size: .72rem; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* email reading pane */
.email-layout { display: grid; grid-template-columns: 190px 300px 1fr; min-height: 560px; }
.email-col-divider { border-right: 1px solid #f0f1f5; }
.email-list-scroll { max-height: 560px; overflow-y: auto; }
.email-item.active { background: #f0f1ff; }
.email-item.unread .email-from, .email-item.unread .email-subject { font-weight: 700; color: #111; }
.email-reading-pane { padding: 20px 24px; overflow-y: auto; max-height: 560px; }
.email-reading-head { border-bottom: 1px solid #eceef3; padding-bottom: 14px; margin-bottom: 14px; }
.email-reading-subject { font-size: 1.05rem; font-weight: 700; color: #111; margin-bottom: 8px; }
.email-reading-meta { display: flex; align-items: center; gap: 10px; }
.email-reading-body { font-size: .86rem; color: #333; line-height: 1.7; white-space: pre-wrap; }

@media (max-width: 900px) {
    .app-sidebar { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .split-panel { grid-template-columns: 1fr; }
}
