/* ============================================================
   ZEDPLUS ADMIN PANEL UI
   Visual Studio 2010 / ASP.NET WebForms / .NET 4.0 compatible
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body,
form {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #343a40;
    background: #f4f6f9;
}

a {
    text-decoration: none;
}

/* =========================
   MAIN ADMIN LAYOUT
   ========================= */

.admin-layout {
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 1000;
    background: #343a40;
    color: #c2c7d0;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .12);
    transition: width .22s ease, left .22s ease;
}

.sidebar-brand {
    height: 144px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #e9ecef;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: #343a40;
}

.brand-logo {
    width: 43px;
    height: 43px;
    margin-right: 9px;
    border-radius: 7px 13px 7px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 43px;
    font-size: 18px;
    font-weight: 900;
    font-style: italic;
    color: #4b2b10;
    background: linear-gradient(135deg, #f0aa35, #bd6825);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
    transform: skew(-8deg);
}

.brand-text {
    color: #d8dce1;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: .2px;
}

.sidebar-user {
    min-height: 66px;
    display: flex;
    align-items: center;
    padding: 10px 20px;
}

.user-avatar {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 9px;
    background: #f1f3f5;
    color: #495057;
    font-size: 18px;
}

.user-name {
    color: #c9cdd2;
    font-size: 15px;
}

.sidebar-separator {
    height: 1px;
    margin: 0 8px 18px;
    background: rgba(255, 255, 255, .13);
}

.sidebar-menu {
    padding: 0 8px 25px;
}

.menu-heading {
    margin: 21px 12px 9px;
    color: #c2c7d0;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
}

.account-heading {
    margin-top: 26px;
}

.menu-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 2px;
    padding: 8px 13px;
    border-radius: 4px;
    color: #c2c7d0;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
}

.menu-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
}

.menu-link.active {
    color: #ffffff;
    background: #007bff;
    box-shadow: 0 1px 4px rgba(0, 123, 255, .28);
}

.menu-icon {
    width: 28px;
    margin-right: 4px;
    text-align: center;
    font-size: 18px;
}

.admin-main {
    min-height: 100vh;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    transition: margin-left .22s ease;
}

.admin-topbar {
    height: 57px;
    flex: 0 0 57px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 7px;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-toggle {
    width: 50px;
    height: 44px;
    border: 1px solid #212529;
    border-radius: 4px;
    background: #ffffff;
    color: #343a40;
    cursor: pointer;
    font-size: 20px;
}

.sidebar-toggle:hover {
    background: #f1f3f5;
}

.topbar-app-name {
    color: #6c757d;
    font-size: 13px;
}

.admin-content {
    flex: 1 0 auto;
    padding: 28px 22px 40px;
    background: #f4f6f9;
}

.admin-footer {
    min-height: 49px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 13px;
    background: #ffffff;
    border-top: 1px solid #dee2e6;
    color: #7b8490;
    font-size: 13px;
}

.admin-footer strong {
    color: #368bd6;
}

/* COLLAPSED MENU */
body.sidebar-collapsed .admin-sidebar {
    width: 72px;
}

body.sidebar-collapsed .admin-main {
    margin-left: 72px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .user-name,
body.sidebar-collapsed .menu-link span,
body.sidebar-collapsed .menu-heading {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    padding: 0 14px;
}

body.sidebar-collapsed .brand-logo {
    margin-right: 0;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 0;
}

body.sidebar-collapsed .user-avatar {
    margin-right: 0;
}

body.sidebar-collapsed .menu-link {
    justify-content: center;
    padding-left: 5px;
    padding-right: 5px;
}

body.sidebar-collapsed .menu-icon {
    margin: 0;
    width: auto;
}

/* =========================
   PAGE HEADER
   ========================= */

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 2px 8px 20px;
}

.content-title {
    margin: 0;
    color: #111820;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 500;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #657080;
    font-size: 14px;
}

.breadcrumb a {
    color: #007bff;
}

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

.breadcrumb .home-icon {
    margin-right: 2px;
}

/* =========================
   DASHBOARD INFO BOXES
   ========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.info-box {
    min-height: 82px;
    display: flex;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d9dde2;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.13);
}

.info-box-icon {
    width: 70px;
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 31px;
}

.info-box-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 10px;
}

.info-box-title {
    color: #333b45;
    font-size: 14px;
    margin-bottom: 5px;
}

.info-box-link {
    color: #007bff;
}

.info-box-number {
    color: #111820;
    font-size: 15px;
    font-weight: 700;
}

.bg-cyan   { background: #17a2b8; }
.bg-green  { background: #28a745; }
.bg-yellow { background: #ffc107; color: #17304a; }
.bg-red    { background: #dc3545; }
.bg-blue   { background: #007bff; }
.bg-orange { background: #fd7e14; }

.dashboard-grid.second-row {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.quick-card-link {
    color: inherit;
}

/* =========================
   CARD / PANEL
   ========================= */

.admin-card,
.zp-card,
.card {
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #d9dde2;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.10);
    overflow: hidden;
}

.card-header {
    min-height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 16px;
    border-bottom: 1px solid #e4e7eb;
    background: #ffffff;
}

.card-title,
.zp-card-title,
.title {
    margin: 0;
    color: #212529;
    font-size: 18px;
    font-weight: 500;
}

.card-subtitle,
.zp-card-subtitle {
    margin: 4px 0 0;
    color: #8a929a;
    font-size: 12px;
}

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

/* fallback padding for ASP panels that do not have card-body */
.zp-card {
    padding: 16px;
}

/* =========================
   FORMS
   ========================= */

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

.form-group {
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label,
.label,
.store-select-label {
    display: block;
    width: auto;
    padding: 0;
    margin: 0 0 6px;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
}

.required {
    color: #dc3545;
}

.input,
.zp-input,
select.input,
textarea.input {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #ffffff;
    color: #495057;
    font-family: inherit;
    font-size: 14px;
    outline: 0;
}

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

.input:focus,
.zp-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0,123,255,.12);
}

.hint {
    display: block;
    margin-top: 5px;
    color: #89919a;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf0f2;
}

/* =========================
   BUTTONS
   ========================= */

.btn {
    display: inline-block;
    min-height: 37px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
    color: #ffffff;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.btn-default {
    background: #ffffff;
    border-color: #ced4da;
    color: #495057;
}

.btn:hover {
    filter: brightness(.96);
}

.btn-lg {
    min-height: 40px;
    padding: 8px 17px;
}

.btn .fa,
input.btn {
    vertical-align: middle;
}

/* =========================
   ALERT / MESSAGE
   ========================= */

.msg {
    display: block;
    margin: 0 0 15px;
    padding: 10px 14px;
    border-radius: 4px;
    font-weight: 600;
}

/* =========================
   TABLE TOOLBAR / GRID
   ========================= */

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

.table-toolbar h3 {
    margin: 0;
    color: #343a40;
    font-size: 17px;
    font-weight: 500;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 3px;
}

.grid {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    border-spacing: 0;
    background: #ffffff;
}

.grid th {
    padding: 10px 10px;
    border-right: 1px solid #d6dbe0;
    border-bottom: 1px solid #ccd2d8;
    background: #e9ecef;
    color: #2e343a;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.grid th:last-child {
    border-right: 0;
}

.grid td {
    padding: 9px 10px;
    border-right: 1px solid #e2e5e8;
    border-bottom: 1px solid #e2e5e8;
    color: #343a40;
    vertical-align: middle;
}

.grid td:last-child {
    border-right: 0;
}

.grid tr:last-child td {
    border-bottom: 0;
}

.grid tr:hover td {
    background: #f8f9fa;
}

.grid a {
    color: #007bff;
    font-weight: 500;
}

.grid a:hover {
    text-decoration: underline;
}

.grid input[type="checkbox"],
.select-all-box input[type="checkbox"] {
    width: 15px;
    height: 15px;
    vertical-align: -2px;
}

.grid table {
    margin: 5px auto;
}

.grid table td {
    padding: 3px;
    border: 0;
}

.grid table a,
.grid table span {
    display: inline-block;
    min-width: 29px;
    height: 29px;
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    text-align: center;
}

.grid table span {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.status-badge {
    display: inline-block;
    min-width: 68px;
    padding: 4px 8px;
    border-radius: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: #d9f2df;
    color: #187b35;
}

.status-muted {
    background: #e9ecef;
    color: #6c757d;
}

/* =========================
   PINCODE ALLOTMENT
   ========================= */

.store-select-box {
    max-width: 580px;
    margin-bottom: 18px;
}

.store-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    border: 0;
}

.summary-item {
    min-height: 75px;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

.summary-label {
    display: block;
    margin-bottom: 5px;
    color: #7a838d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.summary-value {
    display: block;
    color: #343a40;
    font-size: 15px;
    font-weight: 700;
    word-break: break-word;
}

.radius-value {
    color: #007bff;
}

.select-all-box {
    padding: 7px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #f8f9fa;
    color: #495057;
}

/* =========================
   PINCODE IMPORT
   ========================= */

.upload-box {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px dashed #adb5bd;
    border-radius: 4px;
    background: #f8f9fa;
}

.upload-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 4px;
    background: #17a2b8;
    color: #ffffff;
    font-size: 20px;
}

.code-sample {
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 3px;
    background: #343a40;
    color: #f8f9fa;
    font-family: Consolas, monospace;
    font-size: 12px;
    overflow-x: auto;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
    .dashboard-grid,
    .dashboard-grid.second-row {
        grid-template-columns: repeat(2, minmax(190px, 1fr));
    }

    .store-summary {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        left: -250px;
        width: 250px;
    }

    .admin-main {
        margin-left: 0;
    }

    body.sidebar-collapsed .admin-sidebar {
        left: 0;
        width: 250px;
    }

    body.sidebar-collapsed .admin-main {
        margin-left: 0;
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .user-name,
    body.sidebar-collapsed .menu-link span,
    body.sidebar-collapsed .menu-heading {
        display: initial;
    }

    body.sidebar-collapsed .sidebar-brand {
        padding: 0 20px;
    }

    body.sidebar-collapsed .brand-logo {
        margin-right: 9px;
    }

    body.sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
        padding: 10px 20px;
    }

    body.sidebar-collapsed .user-avatar {
        margin-right: 9px;
    }

    body.sidebar-collapsed .menu-link {
        justify-content: flex-start;
        padding: 8px 13px;
    }

    body.sidebar-collapsed .menu-icon {
        width: 28px;
        margin-right: 4px;
    }

    .topbar-app-name {
        display: none;
    }

    .admin-content {
        padding: 20px 12px 30px;
    }

    .content-header {
        align-items: flex-start;
        flex-direction: column;
        margin-left: 2px;
        margin-right: 2px;
    }

    .content-title {
        font-size: 25px;
    }

    .dashboard-grid,
    .dashboard-grid.second-row,
    .form-grid,
    .store-summary {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .table-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
