/* ============================================================
   OneShare - Painel de Gerenciamento
   Tema customizado sobre Bootstrap 5
   ============================================================ */

:root {
    --os-primary: #2563eb;
    --os-primary-dark: #1d4ed8;
    --os-primary-soft: #eff6ff;
    --os-sidebar-bg: #0f172a;
    --os-sidebar-hover: #1e293b;
    --os-sidebar-active: #2563eb;
    --os-body-bg: #f1f5f9;
    --os-card-border: #e2e8f0;
    --os-text: #0f172a;
    --os-text-muted: #64748b;
    --os-sidebar-width: 240px;
    --os-topbar-height: 60px;
}

html, body {
    height: 100%;
}

body {
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    background-color: var(--os-body-bg);
    color: var(--os-text);
    font-size: 0.925rem;
}

/* ------------------------------------------------------------
   Layout: sidebar + conteudo
   ------------------------------------------------------------ */
.os-layout {
    min-height: 100vh;
}

.os-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--os-sidebar-width);
    background: var(--os-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.os-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.os-brand i {
    color: #60a5fa;
    font-size: 1.4rem;
}

.os-brand:hover {
    color: #fff;
}

.os-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

.os-nav-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    padding: 14px 12px 6px;
    font-weight: 600;
}

.os-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.os-nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.os-nav-link:hover {
    background: var(--os-sidebar-hover);
    color: #e2e8f0;
}

.os-nav-link.active {
    background: var(--os-sidebar-active);
    color: #fff;
}

.os-sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    font-size: 0.75rem;
}

.os-main {
    margin-left: var(--os-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.os-topbar {
    height: var(--os-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--os-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.os-topbar .dropdown-toggle {
    color: var(--os-text);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.os-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--os-primary-soft);
    color: var(--os-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.os-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

/* Toggler mobile */
.os-toggler {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--os-text);
    padding: 4px 8px;
}

.os-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .os-sidebar {
        transform: translateX(-100%);
    }
    .os-sidebar.show {
        transform: translateX(0);
    }
    .os-main {
        margin-left: 0;
    }
    .os-toggler {
        display: inline-block;
    }
    .os-backdrop.show {
        display: block;
    }
    .os-content {
        padding: 16px;
    }
}

/* ------------------------------------------------------------
   Cabecalho de pagina
   ------------------------------------------------------------ */
.os-page-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.os-page-header h2 i {
    color: var(--os-primary);
    margin-right: 6px;
}

.os-page-header p {
    color: var(--os-text-muted);
    margin-bottom: 0;
    font-size: 0.875rem;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

h2 i {
    color: var(--os-primary);
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
    border: 1px solid var(--os-card-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef2f6;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 12px 16px;
}

.card-header h5, .card-header h6 {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-header i {
    color: var(--os-primary);
}

/* Cards de estatistica do dashboard */
.os-stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.os-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.os-stat-icon.primary { background: #dbeafe; color: #1d4ed8; }
.os-stat-icon.success { background: #dcfce7; color: #15803d; }
.os-stat-icon.warning { background: #fef3c7; color: #b45309; }
.os-stat-icon.dark    { background: #e2e8f0; color: #334155; }

.os-stat-label {
    font-size: 0.78rem;
    color: var(--os-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 2px;
}

.os-stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

/* Card de token de API */
.os-token-card code {
    background: #0f172a;
    color: #7dd3fc;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
}

/* ------------------------------------------------------------
   Tabelas
   ------------------------------------------------------------ */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--os-text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--os-card-border);
    font-weight: 600;
    padding: 10px 12px;
    white-space: nowrap;
}

.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.table-hover tbody tr:hover td {
    background-color: #f8fafc;
}

/* ------------------------------------------------------------
   Badges suaves (substituem cores saturadas do Bootstrap)
   ------------------------------------------------------------ */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 20px;
}

.badge.bg-success   { background-color: #dcfce7 !important; color: #15803d !important; }
.badge.bg-danger    { background-color: #fee2e2 !important; color: #b91c1c !important; }
.badge.bg-warning   { background-color: #fef3c7 !important; color: #92400e !important; }
.badge.bg-info      { background-color: #e0f2fe !important; color: #0369a1 !important; }
.badge.bg-secondary { background-color: #e2e8f0 !important; color: #475569 !important; }
.badge.bg-primary   { background-color: #dbeafe !important; color: #1d4ed8 !important; }
.badge.bg-dark      { background-color: #e2e8f0 !important; color: #1e293b !important; }

/* ------------------------------------------------------------
   Botoes
   ------------------------------------------------------------ */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-sm {
    border-radius: 7px;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--os-primary);
    border-color: var(--os-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--os-primary-dark);
    border-color: var(--os-primary-dark);
}

.btn-outline-primary {
    color: var(--os-primary);
    border-color: #bfdbfe;
}

.btn-outline-primary:hover {
    background-color: var(--os-primary);
    border-color: var(--os-primary);
}

/* btn-info e usado como acao "visualizar" - vira botao neutro */
.btn-info {
    background-color: #fff;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-info:hover, .btn-info:focus {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.btn-warning:hover, .btn-warning:focus {
    background-color: #fde68a;
    border-color: #fcd34d;
    color: #78350f;
}

.btn-danger {
    background-color: #fff;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-danger:hover, .btn-danger:focus {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* Botoes de confirmacao dentro de modais voltam a ser solidos */
.modal-footer .btn-danger, .modal-footer .btn-warning {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.modal-footer .btn-warning {
    background-color: #d97706;
    border-color: #d97706;
}

.modal-footer .btn-danger:hover { background-color: #b91c1c; border-color: #b91c1c; }
.modal-footer .btn-warning:hover { background-color: #b45309; border-color: #b45309; }

.btn-group .btn {
    margin: 0;
}

/* ------------------------------------------------------------
   Formularios
   ------------------------------------------------------------ */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #cbd5e1;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--os-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #334155;
}

.input-group-text {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--os-text-muted);
}

/* ------------------------------------------------------------
   Abas (view_client)
   ------------------------------------------------------------ */
.nav-tabs {
    border-bottom: 1px solid var(--os-card-border);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--os-text-muted);
    font-weight: 500;
    padding: 10px 16px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--os-text);
    border-bottom-color: #cbd5e1;
}

.nav-tabs .nav-link.active {
    color: var(--os-primary);
    background: transparent;
    border-bottom: 2px solid var(--os-primary);
    font-weight: 600;
}

.tab-content {
    border: 1px solid var(--os-card-border) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ------------------------------------------------------------
   Modais, alertas, breadcrumb e diversos
   ------------------------------------------------------------ */
.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.modal-header {
    border-bottom: 1px solid #eef2f6;
}

.modal-header.bg-primary {
    background-color: var(--os-primary) !important;
}

.modal-header.bg-primary i, .modal-header.bg-danger i {
    color: #fff;
}

.alert {
    border-radius: 10px;
    font-size: 0.875rem;
}

.breadcrumb {
    background-color: transparent;
    padding-left: 0;
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.breadcrumb a {
    color: var(--os-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--os-primary);
}

code {
    background-color: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.85em;
}

pre {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

details summary {
    cursor: pointer;
    user-select: none;
}

details summary:hover {
    text-decoration: underline;
}

.progress {
    background-color: #e2e8f0;
    border-radius: 20px;
}

.progress-bar {
    border-radius: 20px;
}

.list-group-item {
    border-color: #eef2f6;
    font-size: 0.875rem;
}

.list-group-item-action:hover {
    background-color: #f8fafc;
}

/* Estado vazio */
.os-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--os-text-muted);
}

.os-empty i {
    font-size: 3rem;
    color: #cbd5e1;
}

/* ------------------------------------------------------------
   Telas de autenticacao (login / registro)
   ------------------------------------------------------------ */
.os-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.os-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 40px 36px;
}

.os-auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.os-auth-brand i {
    font-size: 2.6rem;
    color: var(--os-primary);
}

.os-auth-brand h3 {
    font-weight: 700;
    margin: 8px 0 2px;
}

.os-auth-brand p {
    color: var(--os-text-muted);
    font-size: 0.875rem;
    margin: 0;
}
