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

body {
    font-family: -apple-system, 'Segoe UI', sans-serif;
    background: #f5f5f9;
    color: #333;
    line-height: 1.6;
}

/* ===== SIDEBAR LAYOUT ===== */
.layout-sidebar {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    min-height: calc(100vh - 70px);
    background: #1a1a2e;
    padding: 24px 0;
    position: sticky;
    top: 70px;
    flex-shrink: 0;
}

.sidebar-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 0 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}

.sidebar a:hover {
    color: #fff;
    background: rgba(108,99,255,.2);
}

.sidebar a.active {
    color: #fff;
    background: #6c63ff;
    border-radius: 0;
}

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

.content-area {
    flex: 1;
    padding: 32px;
    min-width: 0;
}

/* ===== PAGE HEADER ===== */
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}

/* ===== CARDS ===== */
.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header-custom {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 20px 24px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #6c63ff;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* ===== DASHBOARD BUTTONS ===== */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dash-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
    cursor: pointer;
}

.dash-btn:hover {
    border-color: #6c63ff;
    color: #6c63ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108,99,255,.12);
}

.dash-btn i {
    font-size: 28px;
    color: #6c63ff;
}

/* ===== BUTTONS ===== */
.btn-primary-custom {
    display: inline-block;
    padding: 10px 24px;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}

.btn-primary-custom:hover { background: #5a52d5; color: #fff; }

.btn-secondary-custom {
    display: inline-block;
    padding: 10px 24px;
    background: transparent;
    color: #666;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}

.btn-secondary-custom:hover {
    border-color: #6c63ff;
    color: #6c63ff;
}

.btn-danger-custom {
    display: inline-block;
    padding: 10px 24px;
    background: #ff4757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}

.btn-danger-custom:hover { background: #e8384f; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }

.form-label-custom {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: #fafafa;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color .2s;
}

.form-input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,.1);
    background: #fff;
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ===== TABLES ===== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-custom th {
    background: #f5f5f9;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e8e8e8;
}

.table-custom td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.table-custom tr:hover td {
    background: #fafafe;
}

/* ===== PROFILE ===== */
.profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #6c63ff;
}

.profile-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: linear-gradient(135deg, #6c63ff, #4834d4);
    color: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
}

.welcome-banner h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.welcome-banner p {
    opacity: .85;
    font-size: 14px;
}

/* ===== BADGES ===== */
.badge-custom {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-purple { background: rgba(108,99,255,.1); color: #6c63ff; }
.badge-green { background: rgba(46,213,115,.1); color: #2ed573; }
.badge-red { background: rgba(255,71,87,.1); color: #ff4757; }

/* ===== PAGINATION ===== */
.pagination-custom {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination-custom a, .pagination-custom span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #666;
    border: 1px solid #e0e0e0;
    transition: all .2s;
}

.pagination-custom a:hover {
    border-color: #6c63ff;
    color: #6c63ff;
}

.pagination-custom .active {
    background: #6c63ff;
    color: #fff;
    border-color: #6c63ff;
}

/* ===== COMMUNITY ===== */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
    text-decoration: none;
    color: #333;
    transition: all .2s;
}

.post-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

.post-item-title {
    font-weight: 600;
    font-size: 15px;
}

.post-item-meta {
    font-size: 12px;
    color: #999;
}

/* ===== NOTICE CARDS ===== */
.notice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.notice-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: all .2s;
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.notice-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.notice-card-body {
    padding: 16px;
}

.notice-card-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.notice-card-body p {
    font-size: 13px;
    color: #888;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== CHART CARD ===== */
.chart-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 24px;
    margin-top: 20px;
}

.chart-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .layout-sidebar {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 99;
        transform: translateX(-100%);
        transition: transform .3s;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

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

    .content-area { padding: 20px 16px; }

    .sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #6c63ff;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 18px;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 100;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(108,99,255,.3);
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-card { flex-direction: column; text-align: center; }
    .notice-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
    .sidebar-toggle { display: none !important; }
}
