/* ═══════════════════════════════════════════════════════════════
   Fluentus backend (prati) - self-contained stylesheet.
   Mirrors the marketing site theme tokens from style/styles.css so
   the folder can be served alone on prati.fluentus.app.
═══════════════════════════════════════════════════════════════ */

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

:root {
    --primary-purple: #7e57c2;
    --primary-pink: #e91e63;
    --gradient-primary: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-pink) 100%);
    --text-dark: #1a202c;
    --text-medium: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-light: #e2e8f0;
    --sidebar-bg: #231a35;
    --sidebar-width: 220px;
    --sidebar-width-collapsed: 56px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES (login, forgot password, reset)
═══════════════════════════════════════════════════════════════ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.25rem rgba(126, 87, 194, 0.25);
    outline: none;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 2.6rem;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    padding: 0 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--text-medium);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 1.1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--primary-purple);
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
    display: none;
}

.auth-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL (sidebar + main)
═══════════════════════════════════════════════════════════════ */

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 32px 28px;
}

.admin-main h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.admin-main .page-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   Default width comes from the breakpoint: collapsed on phones,
   expanded from 640px up. Once the user clicks the toggle, the
   .is-collapsed / .is-expanded class wins over the breakpoint.
═══════════════════════════════════════════════════════════════ */

.admin-sidebar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: var(--sidebar-width-collapsed);
    transition: width 0.2s ease-in-out;
}

@media (min-width: 640px) {
    .admin-sidebar {
        width: var(--sidebar-width);
    }
}

.admin-sidebar.is-collapsed {
    width: var(--sidebar-width-collapsed);
}

.admin-sidebar.is-expanded {
    width: var(--sidebar-width);
}

/* Elements hidden while collapsed (labels, brand text, user name) */
.sidebar-label {
    display: none;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .sidebar-label {
        display: block;
    }
}

.is-collapsed .sidebar-label {
    display: none;
}

.is-expanded .sidebar-label {
    display: block;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (min-width: 640px) {
    .sidebar-head {
        justify-content: space-between;
        padding: 18px 18px;
    }
}

.is-collapsed .sidebar-head {
    justify-content: center;
    padding: 16px 8px;
}

.is-expanded .sidebar-head {
    justify-content: space-between;
    padding: 18px 18px;
}

.sidebar-brand {
    min-width: 0;
}

.sidebar-brand .brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    background: linear-gradient(135deg, #b39ddb 0%, #f48fb1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.sidebar-brand .brand-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
}

.sidebar-toggle {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.sidebar-toggle:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
}

/* Chevron direction: show "expand" arrow when collapsed, "collapse" when expanded */
.icon-expand { display: block; }
.icon-collapse { display: none; }

@media (min-width: 640px) {
    .icon-expand { display: none; }
    .icon-collapse { display: block; }
}

.is-collapsed .icon-expand { display: block; }
.is-collapsed .icon-collapse { display: none; }
.is-expanded .icon-expand { display: none; }
.is-expanded .icon-collapse { display: block; }

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}

@media (min-width: 640px) {
    .sidebar-nav a {
        justify-content: flex-start;
        padding: 9px 12px;
    }
}

.is-collapsed .sidebar-nav a {
    justify-content: center;
    padding: 10px 0;
}

.is-expanded .sidebar-nav a {
    justify-content: flex-start;
    padding: 9px 12px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--gradient-primary);
    color: #fff;
}

.sidebar-nav a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.sidebar-user {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 640px) {
    .sidebar-user {
        align-items: flex-start;
        padding: 14px 18px;
    }
}

.is-collapsed .sidebar-user {
    align-items: center;
    padding: 14px 8px;
}

.is-expanded .sidebar-user {
    align-items: flex-start;
    padding: 14px 18px;
}

.sidebar-user .user-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-signout {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    font-family: inherit;
}

.sidebar-signout:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
}

.sidebar-signout svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE (contacted page)
═══════════════════════════════════════════════════════════════ */

.table-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.table-count {
    font-size: 0.8rem;
    color: var(--text-light);
}

.table-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    white-space: nowrap;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
    color: var(--text-medium);
    vertical-align: top;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table .cell-strong {
    color: var(--text-dark);
    font-weight: 600;
}

.data-table .cell-message {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.data-table .cell-clip {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table .cell-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
}

.data-table .cell-wrap {
    white-space: normal;
    max-width: 420px;
    min-width: 220px;
}

.data-table a {
    color: var(--primary-purple);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.tech-table {
    font-size: 0.85rem;
}

.tech-table td {
    padding: 12px;
}

.state-panel {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.state-error {
    max-width: 640px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .admin-main {
        padding: 24px 14px;
    }
}
