/* ============================================================
   ORVO Admin — Shared Stylesheet
   Theme: Dark, Outfit font, Teal accent (#188796)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: #000000;
    color: #FFFFFF;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: pageIn 0.15s ease-out forwards;
    overflow-x: hidden;
}

body.page-exit {
    animation: pageOut 0.1s ease-in forwards;
}

a { color: #188796; text-decoration: none; }
a:hover { color: #73D1DE; }

/* --- Header --- */
.header {
    background: #0a0a0a;
    border-bottom: 1px solid #333333;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #FFFFFF;
}

.logo img {
    height: 28px;
    filter: brightness(0) invert(1) opacity(0.9);
}

.logo-label {
    font-size: 14px;
    font-weight: 400;
    color: #888888;
    letter-spacing: 0.05em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    color: #888888;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}

.header-nav a:hover {
    color: #FFFFFF;
    background: #1a1a1a;
}

.header-nav a.nav-active {
    color: #188796;
}

.header-nav .nav-sep {
    width: 1px;
    height: 20px;
    background: #333333;
    margin: 0 4px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.header-user-name {
    font-size: 13px;
    color: #888888;
}

.btn-logout {
    background: none;
    border: 1px solid #333333;
    color: #888888;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-logout:hover {
    color: #B52B2B;
    border-color: #B52B2B;
    background: rgba(181, 43, 43, 0.1);
}

/* --- Footer --- */
.footer {
    background: #0a0a0a;
    border-top: 1px solid #222222;
    padding: 10px 24px;
    font-size: 12px;
    color: #555555;
    text-align: center;
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

/* --- Page Layout --- */
.page {
    flex: 1;
    padding: 88px 24px 60px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888888;
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: #888888;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumbs a:hover {
    color: #188796;
}

.breadcrumbs .sep {
    color: #444444;
}

.breadcrumbs .current {
    color: #CCCCCC;
}

/* --- Cards --- */
.card {
    background: #171717;
    border: 1px solid #333333;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.card-sm {
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 20px;
}

.card-form {
    max-width: 560px;
    margin: 0 auto;
}

.card-logo {
    display: block;
    width: 180px;
    margin: 0 auto 12px;
    filter: brightness(0) invert(1) opacity(0.9);
}

.card p.card-subtitle {
    font-size: 14px;
    color: #888888;
    text-align: center;
    margin-bottom: 28px;
    font-weight: 300;
}

/* --- Stats Row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #171717;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 16px 20px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #888888;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
}

/* --- Forms --- */
.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #AAAAAA;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: #222222;
    color: #FFFFFF;
    border: 1px solid #444444;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #666666;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #188796;
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.field select option {
    background: #222222;
    color: #FFFFFF;
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-readonly {
    font-size: 16px;
    color: #CCCCCC;
    padding: 12px 0;
}

.field .hint {
    font-size: 12px;
    color: #666666;
    margin-top: 4px;
}

.error-msg {
    font-size: 13px;
    color: #B52B2B;
    text-align: center;
    margin-bottom: 12px;
    min-height: 18px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #171717;
    color: #FFFFFF;
    border: 1px solid #444444;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.btn:hover {
    background: #2a2a2a;
    border-color: #666666;
    color: #FFFFFF;
}

.btn:active {
    background: #3a3a3a;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-accent {
    background: #188796;
    border-color: #188796;
}

.btn-accent:hover {
    background: #1a9dae;
    border-color: #1a9dae;
}

.btn-accent:active {
    background: #05616E;
}

.btn-danger {
    background: #B52B2B;
    border-color: #B52B2B;
}

.btn-danger:hover {
    background: #d13030;
    border-color: #d13030;
}

.btn-danger:active {
    background: #8a2020;
}

.btn-success {
    background: #0CAB41;
    border-color: #0CAB41;
}

.btn-success:hover {
    background: #0dc34a;
    border-color: #0dc34a;
}

.btn-success:active {
    background: #0a8a35;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* --- Tables --- */
.table-wrap {
    background: #171717;
    border: 1px solid #333333;
    border-radius: 10px;
    overflow: hidden;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 1px solid #333333;
    background: #111111;
}

.table-wrap td {
    padding: 14px 16px;
    font-size: 14px;
    color: #CCCCCC;
    border-bottom: 1px solid #222222;
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

.table-wrap tr:hover td {
    background: #1a1a1a;
}

.table-wrap td a {
    color: #188796;
    text-decoration: none;
    font-weight: 500;
}

.table-wrap td a:hover {
    color: #73D1DE;
}

.table-empty {
    text-align: center;
    padding: 40px 16px;
    color: #666666;
    font-size: 14px;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: rgba(12, 171, 65, 0.15);
    color: #0CAB41;
}

.badge-inactive {
    background: rgba(181, 43, 43, 0.15);
    color: #B52B2B;
}

.badge-pending {
    background: rgba(24, 135, 150, 0.15);
    color: #188796;
}

.badge-expired {
    background: rgba(183, 72, 31, 0.15);
    color: #B7481F;
}

.badge-completed {
    background: rgba(12, 171, 65, 0.15);
    color: #0CAB41;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #171717;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 14px;
    color: #CCCCCC;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.2s ease-out;
    max-width: 360px;
}

.toast-success {
    border-color: #0CAB41;
    color: #0CAB41;
}

.toast-error {
    border-color: #B52B2B;
    color: #B52B2B;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* --- Page Transitions --- */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

/* --- Setup Link Box --- */
.setup-link-box {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.setup-link-box input {
    flex: 1;
    background: #222222;
    border: 1px solid #444444;
    border-radius: 6px;
    padding: 10px 14px;
    color: #188796;
    font-size: 14px;
    font-family: monospace;
    outline: none;
}

/* --- Hero (index page) --- */
.hero {
    text-align: center;
    padding: 40px 24px;
    margin-top: max(10vh, 40px);
}

.hero-logo {
    display: block;
    width: min(400px, 70vw);
    margin: 0 auto 24px;
    filter: brightness(0) invert(1) opacity(0.9);
}

.hero-badge {
    display: inline-block;
    background: #171717;
    border: 1px solid #2A2A2A;
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 13px;
    color: #888888;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
}

.hero-badge span {
    color: #188796;
}

.hero p {
    font-size: 18px;
    color: #888888;
    max-width: 440px;
    margin: 0 auto 32px;
    line-height: 1.6;
    font-weight: 300;
}

/* --- Login Card (centered layout) --- */
.main-centered {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    padding-top: max(10vh, 40px);
}

.card-login {
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666666;
    text-decoration: none;
    transition: color 0.15s;
}

.back-link:hover {
    color: #188796;
}

/* --- Loading Spinner --- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #555555;
    font-size: 14px;
}

/* --- Section Divider --- */
.section {
    margin-top: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #AAAAAA;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .header { padding: 0 16px; }
    .logo img { height: 22px; }
    .page { padding: 76px 16px 60px; }
    .field-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .card { padding: 24px 20px; }
    .btn-group { flex-direction: column; }
    .header-nav a { padding: 8px 10px; font-size: 13px; }
    .hero-logo { margin-bottom: 16px; }
    .hero p { font-size: 16px; }
    .table-wrap { font-size: 13px; }
    .table-wrap th, .table-wrap td { padding: 10px 12px; }
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: modalFadeIn 0.15s ease-out forwards;
}

.modal-overlay.closing {
    animation: modalFadeOut 0.1s ease-in forwards;
}

.modal {
    background: #171717;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    animation: modalScaleIn 0.15s ease-out forwards;
}

.modal-overlay.closing .modal {
    animation: modalScaleOut 0.1s ease-in forwards;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 8px;
}

.modal p {
    font-size: 14px;
    color: #AAAAAA;
    margin: 0 0 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
    max-width: 160px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes modalScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes modalScaleOut {
    from { transform: scale(1); opacity: 1; }
    to   { transform: scale(0.95); opacity: 0; }
}
