@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
    --brand-primary: #f28c1b;
    --brand-primary-600: #d8740f;
    --brand-primary-200: #ffd8ad;
    --brand-primary-100: #ffe8cd;
    --brand-primary-50: #fff6ea;
    --brand-soft: #fef6ea;
    --brand-ink: #1f2a37;
    --brand-muted: #6b7280;
    --panel-bg: #ffffff;
    --panel-border: #e4e9f2;
    --page-bg: #f6f8fb;
}

body {
    font-family: "Poppins", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    background: var(--page-bg);
    color: var(--brand-ink);
    line-height: 1.6;
}

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

.admin-sidebar {
    width: 260px;
    flex: 0 0 260px;
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #fffaf2 0%, #f5fbf3 100%);
    border-right: 1px solid var(--panel-border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 24px;
}

.sidebar-body {
    padding: 0 12px 20px;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--brand-ink);
    font-weight: 700;
    width: 100%;
    justify-content: center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: radial-gradient(circle at top, #ffd08a, var(--brand-primary));
    color: #fff;
    font-weight: 700;
}

.brand-logo {
    max-width: 100%;
    height: 48px;
    width: auto;
    display: block;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.sidebar-divider {
    height: 1px;
    background: #e6ebf1;
    margin: 6px 0 10px;
}

.sidebar-section {
    margin: 16px 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-muted);
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--brand-ink);
    font-size: 14px;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    background: rgba(242, 140, 27, 0.12);
    color: var(--brand-ink);
}

.sidebar-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--brand-muted);
}

.sidebar-backdrop {
    display: none;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: #fff;
    border-bottom: 1px solid var(--panel-border);
}

.header-title {
    font-size: 18px;
    font-weight: 700;
}

.header-subtitle {
    font-size: 13px;
    color: var(--brand-muted);
}

.profile-dropdown {
    position: relative;
}

.notification-dropdown {
    position: relative;
}

.notification-trigger {
    position: relative;
    border: 1px solid var(--panel-border);
    background: #fff;
    color: var(--brand-ink);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notification-trigger:hover {
    border-color: rgba(242, 140, 27, 0.35);
    box-shadow: 0 8px 18px rgba(242, 140, 27, 0.15);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

.notification-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    box-shadow: 0 18px 30px rgba(31, 42, 55, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 12;
}

.notification-dropdown.open .notification-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--brand-ink);
    border-bottom: 1px solid #eef2f7;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #fff7ed;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-primary-100);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 12px;
    color: var(--brand-muted);
    margin-bottom: 2px;
}

.notification-time {
    font-size: 11px;
    color: var(--brand-muted);
}

.notification-footer {
    display: block;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--brand-primary-600);
    text-decoration: none;
    border-top: 1px solid #eef2f7;
}

.notification-footer:hover {
    text-decoration: underline;
}

.notification-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--brand-muted);
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--brand-soft);
    padding: 6px 12px;
    border-radius: 24px;
    border: 1px solid transparent;
    font: inherit;
    color: var(--brand-ink);
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-trigger:hover {
    border-color: rgba(242, 140, 27, 0.35);
    box-shadow: 0 8px 18px rgba(242, 140, 27, 0.15);
}

.profile-trigger .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.profile-text .user-name {
    font-weight: 600;
    font-size: 13px;
}

.profile-text .user-role {
    font-size: 11px;
    color: var(--brand-muted);
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px;
    min-width: 160px;
    box-shadow: 0 18px 30px rgba(31, 42, 55, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.profile-dropdown:hover .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-content {
    padding: 26px 28px 40px;
    flex: 1;
}

.breadcrumb-bar {
    padding: 12px 28px 0;
}

.breadcrumb {
    margin: 0;
    background: transparent;
    font-size: 12px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--brand-muted);
    padding: 0 8px;
}

.breadcrumb-item a {
    color: var(--brand-primary-600);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active span {
    color: var(--brand-ink);
    font-weight: 500;
}

.content-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(31, 42, 55, 0.06);
}

.filters-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filters-wrapper {
    flex-wrap: nowrap;
}

.filters-inline-main,
.filters-inline-rest {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
}

.filters-inline .form-control,
.filters-inline .form-select {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 250px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.filters-inline .btn {
    min-height: 30px;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
}

.filters-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #f2e6d8;
    background: linear-gradient(135deg, #fff7ec 0%, #ffffff 60%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-label {
    font-size: 12px;
    color: var(--brand-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-ink);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(31, 42, 55, 0.08);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-ink);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 140, 27, 0.15);
    color: var(--brand-primary);
    font-size: 18px;
}

.stat-card--active-users {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 60%);
    border-color: #dceefa;
}

.stat-card--users {
    background: linear-gradient(135deg, #fff9f0 0%, #ffffff 60%);
    border-color: #f5e4cf;
}

.stat-card--mantras {
    background: linear-gradient(135deg, #f1fff2 0%, #ffffff 60%);
    border-color: #d7f0da;
}

.stat-card--jap-logs {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 60%);
    border-color: #f3d7d7;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-muted);
}

.detail-value {
    font-size: 13px;
    font-weight: 600;
}

.admin-footer {
    padding: 16px 28px;
    color: var(--brand-muted);
    border-top: 1px solid var(--panel-border);
    background: #fff;
}

.auth-body {
    background: radial-gradient(circle at top, #fffaf2, #f1f7f2 60%, #eaf0f8 100%);
    min-height: 100vh;
}

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

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 20px 40px rgba(31, 42, 55, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-brand-centered {
    flex-direction: column;
    text-align: center;
    gap: 8px;
}

.auth-brand h1 {
    font-size: 20px;
    margin: 0;
}

.auth-brand p {
    margin: 2px 0 0;
    color: var(--brand-muted);
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    border-color: #d9e2ec;
    font-size: 13px;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9aa4b2;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(242, 140, 27, 0.15);
}

.invalid-feedback {
    font-size: 13px;
}

.btn {
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 13px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

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

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

.btn-secondary {
    background: var(--brand-primary-100);
    border-color: var(--brand-primary-100);
    color: #7a3f00;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--brand-primary-200);
    border-color: var(--brand-primary-200);
    color: #7a3f00;
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--brand-primary);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--brand-primary-600);
    border-color: var(--brand-primary-200);
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--brand-primary-50);
    border-color: var(--brand-primary-200);
    color: var(--brand-primary-600);
}

.table {
    font-size: 13px;
    margin-bottom: 0;
}

.table thead {
    background: #f4f7fb;
}

.table.table-bordered {
    border-color: #e6ebf1;
}

.table.table-bordered > :not(caption) > * > * {
    border-color: #e6ebf1;
    padding: 6px 8px;
}

.table thead th {
    font-weight: 600;
    background: #f1f5f9;
}

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

.table-responsive {
    border-radius: 12px;
    border: 1px solid #e6ebf1;
}

.table .action-cell {
    text-align: center;
    white-space: nowrap;
    width: 140px;
}

.action-icons {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.action-icons form {
    margin: 0;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e6ebf1;
    color: var(--brand-ink);
    background: #fff;
    transition: all 0.2s ease;
    font-size: 16px;
}

.action-icon:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--brand-primary-50);
}

.action-icon.danger:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

@media (max-width: 991px) {
    .admin-shell {
        display: block;
    }

    .admin-main {
        width: 100%;
    }

    .admin-content {
        padding: 20px;
    }

    body {
        font-size: 13px;
    }

    .header-title {
        font-size: 17px;
    }

    .table {
        font-size: 12px;
    }

    .brand-logo {
        height: 40px;
    }

    .breadcrumb-bar {
        padding: 10px 20px 0;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1045;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.25);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease;
        z-index: 1040;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .brand-logo {
        height: 40px;
    }

    .filters-wrapper,
    .filters-inline-main,
    .filters-inline-rest {
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .content-card {
        padding: 18px;
    }

    body {
        font-size: 12px;
    }

    .table {
        font-size: 11px;
    }

    .admin-sidebar .nav-link {
        font-size: 12px;
    }

    .header-title {
        font-size: 16px;
    }

    .brand-logo {
        height: 35px;
    }

    .breadcrumb-bar {
        padding: 8px 16px 0;
    }

    .filters-inline .form-control,
    .filters-inline .form-select {
        width: 100%;
        min-width: 100%;
    }

    .btn {
        padding: 8px 14px;
    }

    .action-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}
