* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #f4f4f4;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h2 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.login-container h3 {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 25px;
}

.login-container form {
    text-align: left;
}

.login-container label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.login-container input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.login-container button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.login-container button:hover {
    background-color: #1a252f;
}

.error-message {
    background-color: #fdecea;
    color: #c0392b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

/*Navbar*/
.navbar {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-title {
    font-size: 18px;
    font-weight: bold;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.navbar-links a {
    color: #fff;
    text-decoration: none;
    background-color: #c0392b;
    padding: 6px 14px;
    border-radius: 4px;
}

.navbar-links a:hover {
    background-color: #a93226;
}

/*Main content area*/
.main-content {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.main-content h1 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.main-content p {
    color: #666;
    margin-bottom: 25px;
}

/*Dashboard cards*/
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card p {
    color: #666;
    margin-bottom: 15px;
}

.card a {
    display: inline-block;
    background-color: #2c3e50;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.card a:hover {
    background-color: #1a252f;
}

/*Page header (title + action button row)*/
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    color: #2c3e50;
}

/*Buttons*/
.btn-primary {
    background-color: #2c3e50;
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #1a252f;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
}

.btn-secondary:hover {
    background-color: #dfe4e6;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 3px;
    text-decoration: none;
    margin-right: 5px;
}

.btn-edit {
    background-color: #2980b9;
    color: #fff;
}

.btn-edit:hover {
    background-color: #21618c;
}

.btn-delete {
    background-color: #c0392b;
    color: #fff;
}

.btn-delete:hover {
    background-color: #922b21;
}

/*Data table*/
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.data-table th {
    background-color: #2c3e50;
    color: #fff;
    text-align: left;
    padding: 12px 15px;
    font-size: 13px;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
}

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

.data-table tr:hover {
    background-color: #f9f9f9;
}

/*Forms*/
.data-form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group-wide {
    flex: 2;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/*Success message*/
.success-message {
    background-color: #eafaf1;
    color: #196f3d;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

/*Search bar*/
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input[type="text"] {
    flex: 1;
    max-width: 350px;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/*Navbar logo*/
.navbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    height: 32px;
    width: 32px;
    object-fit: cover;
    border-radius: 4px;
}

/*Public schedule filter buttons*/
.active-filter {
    background-color: #2c3e50 !important;
    color: #fff !important;
}

/*Chat module*/
.chat-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    height: 450px;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.chat-message-own {
    align-self: flex-end;
    background-color: #2c3e50;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.chat-message-other {
    align-self: flex-start;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-bottom-left-radius: 2px;
}

.chat-message-meta {
    font-size: 11px;
    opacity: 0.75;
    margin-bottom: 3px;
}

.chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-input-form input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
}

/*Mobile Responsiveness*/
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }

    .navbar-links {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px;
    }

    .main-content {
        padding: 0 12px;
        margin: 15px auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .search-bar {
        flex-wrap: wrap;
    }

    .search-bar input[type="text"] {
        max-width: 100%;
        flex-basis: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    /* Make tables horizontally scrollable instead of squished */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card h3 {
        font-size: 24px;
    }

    .chat-box {
        height: 350px;
    }

    .chat-message {
        max-width: 85%;
    }

    .login-container {
        margin: 40px 20px;
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/*Dashboard/Home nav link*/
.nav-home-link {
    background-color: #34495e;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
}

.nav-home-link:hover {
    background-color: #2c3e50;
}

/*Sidebar Layout*/
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #1e2b38;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 48px;              /* adjust to whatever size looks right */
    height: 48px;
    background-color: #ffffff;
    border-radius: 50%;       /* makes it a circle */
    object-fit: contain;      /* keeps the logo's aspect ratio, no stretching */           /* small gap so the logo doesn't touch the circle edge */
    box-sizing: border-box;   /* so padding doesn't push the circle past 48px */
}

.sidebar-logo-placeholder {
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: bold;
    font-size: 14px;
    line-height: 1.3;
}

.sidebar-links {
    flex: 1;
    padding: 12px 0;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
    padding: 16px 20px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.07);
}

.sidebar-link.nav-active {
    background-color: #2980b9;
    font-weight: bold;
}

.sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 8px 0;
}

.sidebar-logout {
    color: #e57373;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #2c3e50;
}

.main-wrapper {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.topbar {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-user {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-badge {
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Overrides so old .main-content rules (from earlier top-navbar layout)
   don't conflict with the new sidebar's main content area */
.main-wrapper .main-content {
    max-width: 100%;
    margin: 0;
    padding: 24px;
}

/*Mobile: collapse sidebar behind a toggle button*/
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: 240px;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
}

/*Dashboard Overview (stat cards + chart + activity log)*/
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #2980b9;
}

.stat-card h3 {
    font-size: 30px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.stat-card p {
    font-size: 13px;
    color: #777;
}

.stat-card.stat-members { border-left-color: #2980b9; }
.stat-card.stat-baptismal { border-left-color: #16a085; }
.stat-card.stat-confirmation { border-left-color: #8e44ad; }
.stat-card.stat-matrimonial { border-left-color: #c0392b; }
.stat-card.stat-events { border-left-color: #d68910; }
.stat-card.stat-donations { border-left-color: #196f3d; }

.dashboard-panels {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

.panel-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.panel-box h2 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.activity-feed {
    list-style: none;
    max-height: 380px;
    overflow-y: auto;
}

.activity-feed li {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.activity-feed li:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.activity-text strong {
    color: #2c3e50;
}

.activity-time {
    color: #999;
    font-size: 11px;
    display: block;
    margin-top: 2px;
}
/*Chat delete message button*/
.chat-delete-btn {
    display: inline-block;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 11px;
    margin-left: 8px;
    text-decoration: none;
    padding: 0 4px;
}

.chat-delete-btn:hover {
    opacity: 1;
    color: #ff6b6b;
}
/*Fellowship category badge & preview*/
.category-badge {
    display: inline-block;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.category-preview-box {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    background-color: #f4f4f4;
    color: #999;
    transition: background-color 0.2s, color 0.2s;
}

.search-bar select {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}
/*Dashboard layout update: equal-width chart
   columns + full-width row below*/
.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-panels-full {
    display: grid;
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}
/*Certificate Fonts (self-hosted, matches real
   Mt. Zion certificate designs)*/
@font-face {
    font-family: 'UnifrakturMaguntia';
    src: url('/sacramental-records-system/assets/fonts/UnifrakturMaguntia.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'DancingScript';
    src: url('/sacramental-records-system/assets/fonts/DancingScript-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'DancingScript';
    src: url('/sacramental-records-system/assets/fonts/DancingScript-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}