/* =====================================================
   Jyoti Stabiliser — ADMIN PANEL (FINAL CLEAN VERSION)
===================================================== */

:root {
    --primary: #E31E24;
    --primary-dark: #c5161b;
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #111827;
    --muted: #6B7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* =====================================================
   LOGIN
===================================================== */

/* ============================= */
/*        ADMIN LOGIN PAGE       */
/* ============================= */

.admin-login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    /* Modern layered gradient */
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .08), transparent 40%),
        linear-gradient(135deg, #1f1f1f, #2e2e2e 60%, #1a1a1a);
}


/* WRAPPER */
.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
}


/* ================= CARD ================= */

.login-card {
    width: 420px;
    /* desktop consistency */
    max-width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 42px 38px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, .35),
        0 0 0 1px rgba(255, 255, 255, .08);

    animation: fadeUp .5s ease;
}


/* Animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ================= TYPOGRAPHY ================= */

.login-title {
    text-align: center;
    margin-bottom: 6px;
    font-size: 26px;
    font-weight: 700;
    color: #111827;
}

.login-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 14px;
}


/* BACK BUTTON */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    text-decoration: none;
    margin-bottom: 10px;
    transition: .25s;
}

.back-btn:hover {
    color: var(--primary);
}


/* ================= INPUTS ================= */

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: .25s;
}

.input-group input {
    width: 100%;
    padding: 15px 14px 15px 44px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 15px;
    background: #fafafa;
    transition: .25s;
}

/* Hover */
.input-group input:hover {
    border-color: #d1d5db;
}

/* Focus */
.input-group input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, .15);
}

.input-group input:focus+i {
    color: var(--primary);
}


/* ================= BUTTON ================= */

.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: .25s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(227, 30, 36, .25);
}

.login-btn:active {
    transform: scale(.98);
}


/* ================= ERROR ================= */

.login-error {
    margin-top: 14px;
    padding: 10px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}


/* ================= RESPONSIVE ================= */

@media (max-width:768px) {

    .login-card {
        padding: 34px 26px;
    }

    .login-title {
        font-size: 22px;
    }
}

@media (max-width:420px) {

    .login-card {
        border-radius: 14px;
        padding: 28px 20px;
    }
}

/* =====================================================
   LAYOUT
===================================================== */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.admin-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #111827, #020617);
    color: #fff;
    padding: 28px 22px;
    box-shadow: 4px 0 30px rgba(0, 0, 0, .25);
    transition: transform .35s ease;
}

.admin-logo {
    text-align: center;
    margin-bottom: 45px;
}

.admin-logo img {
    height: 64px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    transition: .25s;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transform: translateX(4px);
}

.admin-nav a.active {
    background: linear-gradient(135deg, #E31E24, #c5161b);
    color: #fff;
}

.admin-nav .logout {
    margin-top: auto;
    background: #1f2937;
}

/* MAIN */

.admin-content {
    flex: 1;
    padding: 50px 60px;
}

.admin-title {
    font-size: 34px;
    font-weight: 700;
}

/* =====================================================
   TOPBAR
===================================================== */

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle {
    display: none;
    background: #fff;
    border: none;
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

/* =====================================================
   DASHBOARD CARDS
===================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

.dashboard-card {
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    transition: .35s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card:hover {
    transform: translateY(-8px);
}

.card-icon i {
    font-size: 30px;
    color: var(--primary);
}

.card-info h3 {
    font-size: 38px;
    font-weight: 700;
}

.card-info p {
    color: var(--muted);
}

/* =====================================================
   PAGE HEADER
===================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* BACK BUTTON */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-weight: 600;
    color: #374151;
    transition: .25s;
}

.back-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* BUTTON */

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* =====================================================
   TABLE
===================================================== */

.table-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 14px;
    color: #6b7280;
}

.admin-table td {
    padding: 16px 14px;
    border-top: 1px solid #eee;
}

.table-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    background: #f3f4f6;
    padding: 6px;
}

.action-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-btn {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    text-decoration: none;

    font-size: 14px;
}

/* PIN */
.pin-btn {
    background: #eef2ff;
    color: #3b82f6;
}

.pin-btn:hover {
    background: #dbeafe;
}

/* EDIT */
.edit-btn {
    background: #ecfdf5;
    color: #10b981;
}

.edit-btn:hover {
    background: #d1fae5;
}

/* DELETE */
.delete-btn {
    background: #fee2e2;
    color: #ef4444;
}

.delete-btn:hover {
    background: #fecaca;
}

/* .pin-btn {
    margin-right: 10px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.pin-btn:hover {
    text-decoration: underline;
}

.delete-btn {
    color: #ef4444;
    font-weight: 600;
    text-decoration: none;
} */

/* CATEGORY BADGE */

.category-badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.category-badge.residential {
    background: #e0f2fe;
    color: #0369a1;
}

.category-badge.commercial {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.industrial {
    background: #fee2e2;
    color: #991b1b;
}

/* =====================================================
   MODAL
===================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    width: 520px;
    max-width: 90%;
    background: #fff;
    border-radius: 18px;
    padding: 28px;
}

/* =====================================================
   MODAL FORM — MODERN UI
===================================================== */

.modal-content {
    width: 560px;
    max-width: 92%;
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
    animation: modalFade .35s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* HEADER */

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 22px;
}


/* ================= FORM GRID ================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* full width fields */
.form-group.full {
    grid-column: 1 / -1;
}


/* ================= FORM ELEMENTS ================= */

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

/* INPUT + SELECT + TEXTAREA */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    background: #fafafa;
    transition: .25s;
}

/* textarea height */
.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

/* hover */
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #d1d5db;
}

/* focus */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, .15);
}


/* ================= FILE INPUT (BIG IMPROVEMENT) ================= */

.form-group input[type="file"] {
    padding: 10px;
    background: #f9fafb;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    margin-right: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}


/* ================= SUBMIT BUTTON ================= */

.modal-submit {
    margin-top: 24px;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    transition: .25s;
}

.modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(227, 30, 36, .25);
}


/* =====================================================
   SIDEBAR OVERLAY
===================================================== */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);

    opacity: 0;
    visibility: hidden;

    transition: opacity .3s ease;
    z-index: 998;
    /* below sidebar */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.table-video{
    width:70px;
    height:45px;
    object-fit:cover;
    border-radius:6px;
}

.video-badge{
    font-size:13px;
    background:#ff0000;
    color:white;
    padding:6px 10px;
    border-radius:6px;
}

.no-media{
    color:#999;
    font-size:13px;
}

/* =====================================================
   MOBILE SIDEBAR
===================================================== */

@media(max-width:900px) {

    .sidebar-toggle {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .35s ease;
        z-index: 999;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .admin-content {
        padding: 25px 20px;
    }

    .admin-user span {
        display: none;
    }

    .admin-title {
        font-size: 24px;
    }
}

/* =====================================================
   FULL MOBILE TABLE (FIXED VERSION)
===================================================== */

@media(max-width:768px) {

    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        background: #fff;
        border-radius: 14px;
        margin-bottom: 18px;
        padding: 16px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
    }

    .admin-table td {
        display: flex;
        align-items: center;
        gap: 14px;
        border: none;
        padding: 10px 0;
    }

    .admin-table td::before {
        content: attr(data-label);
        min-width: 90px;
        font-weight: 600;
        color: #6b7280;
        font-size: 13px;
    }

    .admin-table td>* {
        flex: 1;
    }

    .table-img {
        width: 60px;
        height: 60px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .btn-primary {
        width: 100%;
    }
}