@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --topbar-height: 52px;
    --sidebar-width: 230px;
    --color-primary: #e74c3c;
    --color-primary-hover: #c0392b;
    --color-red: #ef5350;
    --color-green: #26c281;
    --color-blue: #2b7dfa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-dark);
    background: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #2d3238;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1050;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
}

.navbar-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
}

.navbar-brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.navbar-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 4px;
    user-select: none;
    padding: 0;
    margin-left: 6px;
    transition: background 0.15s ease;
}

.navbar-toggle:hover,
.navbar-toggle:active {
    background: rgba(255,255,255,0.18);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
}

.user-dropdown-btn:hover {
    background: rgba(255,255,255,0.1);
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    color: #2d3238;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-avatar-circle svg {
    width: 16px;
    height: 16px;
    stroke: #2d3238;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    width: 170px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    z-index: 1050;
    overflow: hidden;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #f1f3f5;
}

.user-menu-dropdown a:last-child {
    border-bottom: none;
}

.user-menu-dropdown a:hover {
    background: #f8f9fa;
    color: var(--color-primary);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1040;
    padding: 12px 0 40px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    color: #6c757d;
    flex-shrink: 0;
}

.nav-item:hover {
    background: #f8f9fa;
    color: var(--text-dark);
}

.nav-item:hover svg {
    color: var(--text-dark);
}

.nav-item.active {
    color: var(--color-primary);
    font-weight: 700;
    border-left-color: var(--color-primary);
    background: #fff;
}

.nav-item.active svg {
    color: var(--color-primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 44px;
    color: #6c757d;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-sublink:hover {
    color: var(--color-primary);
    background: #f8f9fa;
}

.nav-sublink.active {
    color: var(--color-primary);
    font-weight: 700;
    background: #fff5f5;
}

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    flex: 1;
    padding: 24px 28px 60px;
    background: #ffffff;
    min-height: calc(100vh - var(--topbar-height));
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.25s ease, width 0.25s ease;
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
        transition: transform 0.25s ease;
    }
    .admin-wrapper.sidebar-collapsed .sidebar,
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    .admin-wrapper.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1040;
        top: var(--topbar-height);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4) !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 16px 14px 60px !important;
        width: 100% !important;
    }
    .navbar-brand {
        font-size: 13.5px;
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .top-navbar {
        padding: 0 10px;
    }
    .navbar-brand {
        max-width: 120px;
        font-size: 12px;
    }
    .stat-grid-4 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    .export-btn-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .export-btn-group .btn-export {
        flex: 1 1 calc(20% - 4px);
        min-width: 46px;
        text-align: center;
        padding: 6px 2px;
        font-size: 11px;
    }
    .search-input-box {
        width: 100%;
    }
    .search-input-box input {
        flex: 1;
        width: 100%;
    }
    .battle-table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.battle-table {
        min-width: 560px;
    }
}

.alert-demo {
    display: none !important;
}

.page-heading {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin: 16px 0 20px;
}

.sub-heading {
    font-size: 17px;
    font-weight: 700;
    color: #212529;
    margin: 28px 0 16px;
}

.stat-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
    width: 100%;
}

.battle-stat-card {
    border-radius: 6px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.stat-card-content {
    margin-left: 14px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.stat-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    margin-bottom: 4px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.stat-card-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}

.stat-card-red {
    background: var(--color-red);
}

.stat-card-green {
    background: var(--color-green);
}

.stat-card-blue {
    background: var(--color-blue);
}

.stat-circle-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-red .stat-circle-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-red);
}

.stat-card-green .stat-circle-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-green);
}

.stat-card-blue .stat-circle-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-blue);
}

.stat-card-content {
    margin-left: 16px;
    flex: 1;
    overflow: hidden;
}

.stat-card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-value {
    font-size: 21px;
    font-weight: 800;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.rupee-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f1c40f;
    color: #7f6000;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
}

.card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 24px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.card-header-bar {
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #212529;
}

.card-body {
    padding: 20px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.export-btn-group {
    display: flex;
    gap: 4px;
}

.btn-export {
    border: 1px solid #e74c3c;
    color: #e74c3c;
    background: #ffffff;
    border-radius: 2px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-export:hover {
    background: #e74c3c;
    color: #ffffff;
}

.search-input-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.search-input-box input {
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
    width: 170px;
}

.search-input-box input:focus {
    border-color: #80bdff;
}

.battle-table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.battle-table-wrap::-webkit-scrollbar {
    height: 5px;
}

.battle-table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.battle-table-wrap::-webkit-scrollbar-track {
    background: #f8fafc;
}

table.battle-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

table.battle-table th {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #212529;
    white-space: nowrap;
}

table.battle-table td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    vertical-align: middle;
    color: #212529;
}

table.battle-table tr:hover {
    background: #fcfcfc;
}

.status-badge-active {
    background: #28a745;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge-pending {
    background: #ffc107;
    color: #212529;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

.status-badge-rejected {
    background: #dc3545;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    margin: 0 2px;
}

.action-view {
    color: #007bff;
}

.action-view:hover {
    background: #e7f1ff;
}

.action-delete {
    color: #dc3545;
}

.action-delete:hover {
    background: #ffebee;
}

.btn-theme {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-theme-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-theme-primary:hover {
    background: var(--color-primary-hover);
    color: #ffffff;
}

.btn-theme-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #ffffff;
}

.btn-theme-outline:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: #495057;
    background: #ffffff;
}

.form-control:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.15);
}

.form-note {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.radio-group {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-top: 6px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.radio-item input {
    accent-color: var(--color-primary);
}

@media print {
    *, *::before, *::after {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important;
        line-height: 1.3 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .top-navbar,
    .sidebar,
    .sidebar-backdrop,
    .navbar-toggle,
    .user-menu-dropdown,
    .alert-demo,
    .table-toolbar,
    .btn,
    .btn-export,
    .btn-theme,
    .action-btn,
    .no-print,
    .filter-card,
    .status-badge-active,
    input[type="checkbox"],
    th:first-child:has(input[type="checkbox"]),
    td:first-child:has(input[type="checkbox"]),
    th.no-print-col,
    td.no-print-col {
        display: none !important;
    }
    .admin-wrapper {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .card-header-bar {
        border: none !important;
        padding: 6px 0 !important;
        background: transparent !important;
    }
    .card-header-title {
        font-size: 14pt !important;
        font-weight: 800 !important;
        color: #000 !important;
    }
    .card-body {
        padding: 0 !important;
    }
    .battle-table-wrap {
        overflow: visible !important;
        width: 100% !important;
        margin: 0 !important;
    }
    table.battle-table {
        width: 100% !important;
        min-width: 100% !important;
        border-collapse: collapse !important;
        border: 1px solid #333 !important;
    }
    table.battle-table th,
    table.battle-table td {
        border: 1px solid #333 !important;
        padding: 6px 8px !important;
        color: #000000 !important;
        font-size: 9.5pt !important;
    }
    table.battle-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: 700 !important;
    }
    .status-badge-active,
    .status-badge-pending,
    .status-badge-rejected {
        background: transparent !important;
        color: #000000 !important;
        border: 1px solid #666 !important;
        padding: 2px 4px !important;
        font-size: 8.5pt !important;
    }
    @page {
        margin: 12mm 10mm;
        size: auto;
    }
}

@media (max-width: 991px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .stat-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    .battle-stat-card {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .battle-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    table.battle-table {
        min-width: 440px !important;
        width: 100% !important;
    }
    table.battle-table th,
    table.battle-table td {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 580px) {
    .stat-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .battle-stat-card {
        padding: 14px 16px !important;
    }
    .stat-circle-icon {
        width: 44px !important;
        height: 44px !important;
    }
    .stat-circle-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
    .stat-card-title {
        font-size: 11px !important;
        white-space: normal !important;
        line-height: 1.3 !important;
    }
    .stat-card-value {
        font-size: 19px !important;
        white-space: nowrap !important;
    }
}
