*{
    box-sizing:border-box;
    -webkit-tap-highlight-color:transparent;
}

html{
    font-size:16px;
}

body{
    margin:0;
    background:#111827;
    font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height:100vh;
}

a{
    text-decoration:none;
    font-weight:bold;
}

/* صفحات الدخول وشراء الكود */
.auth-box{
    width:92%;
    max-width:430px;
    margin:35px auto;
    background:#f8fafc;
    padding:18px;
    border-radius:26px;
    box-shadow:0 12px 35px rgba(0,0,0,.22);
}

.auth-box h2{
    text-align:center;
    margin:0 0 18px;
    font-size:22px;
    color:#0f172a;
}

.auth-box p{
    text-align:center;
    font-size:14px;
    color:#334155;
}

.auth-box a{
    color:#2563eb;
}

.error{
    background:#fee2e2;
    color:#991b1b;
    padding:11px;
    border-radius:14px;
    margin-bottom:12px;
    font-size:14px;
}

.success{
    background:#dcfce7;
    color:#166534;
    padding:11px;
    border-radius:14px;
    margin-bottom:12px;
    font-size:14px;
}

label{
    display:block;
    font-size:13px;
    margin:9px 0 5px;
    color:#334155;
    font-weight:700;
}

input,
select,
button{
    width:100%;
    min-height:44px;
    padding:10px;
    border-radius:13px;
    border:1px solid #cbd5e1;
    font-size:16px;
    background:#fff;
}

button{
    margin-top:12px;
    background:#111827;
    color:#fff;
    border:none;
    font-weight:bold;
    cursor:pointer;
}

.info{
    margin-top:9px;
    background:#f1f5f9;
    border-radius:14px;
    padding:10px;
    font-size:12px;
    line-height:1.7;
    color:#334155;
}

.buy-btn{
    display:block;
    width:100%;
    text-align:center;
    background:#16a34a;
    color:#fff !important;
    padding:13px;
    border-radius:14px;
    margin-top:14px;
    font-size:16px;
}

/* صفحة النظام الرئيسية */
.frame{
    width:100%;
    max-width:430px;
    margin:0 auto;
    padding:8px;
}

.app{
    background:#f3f4f6;
    border-radius:28px;
    padding:12px;
    min-height:100vh;
}

.header{
    background:#111827;
    color:#fff;
    padding:14px 12px;
    text-align:center;
    border-radius:20px;
    font-size:19px;
    font-weight:bold;
}

.user-line{
    font-size:12px;
    margin-top:7px;
    font-weight:normal;
}

.user-line a{
    color:#93c5fd;
}

.panel{
    background:#fff;
    border-radius:20px;
    padding:13px;
    margin:12px 0;
    box-shadow:0 5px 16px rgba(0,0,0,.08);
}

.panel h3{
    margin:0 0 11px;
    font-size:16px;
}

.calendar{
    background:#fff;
    border-radius:22px;
    padding:10px;
    margin-top:10px;
    overflow:hidden;
}

.weekdays,
.days{
    display:grid;
    grid-template-columns:repeat(7, 1fr);
    gap:4px;
}

.weekdays{
    margin-bottom:6px;
}

.weekdays div{
    font-size:8px;
    text-align:center;
    color:#666;
    font-weight:bold;
    white-space:nowrap;
    overflow:hidden;
}

.day{
    aspect-ratio:1;
    border-radius:10px;
    font-size:8px;
    padding:3px;
    background:#e5e7eb;
    text-align:center;
    position:relative;
    overflow:hidden;
}

.work{
    background:#22c55e;
    color:#052e16;
}

.off{
    background:#d1d5db;
    color:#374151;
}

.event{
    background:#a78bfa;
    color:#fff;
}

.today{
    border:2px solid #2563eb;
}

.date{
    font-size:11px;
    font-weight:bold;
    line-height:1;
    margin-bottom:2px;
}

.label{
    font-size:7px;
    line-height:1.1;
}

.badge{
    position:absolute;
    top:1px;
    left:3px;
    font-size:10px;
}

.legend{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
    margin-top:10px;
}

.legend div{
    background:#fff;
    border-radius:14px;
    padding:9px 4px;
    text-align:center;
    font-size:12px;
    box-shadow:0 4px 12px rgba(0,0,0,.05);
}

/* لوحة الإدارة الجديدة للجوال */
.mobile-admin-body{
    margin:0;
    min-height:100vh;
    background:
        radial-gradient(circle at top right, rgba(59,130,246,.28), transparent 30%),
        radial-gradient(circle at top left, rgba(16,185,129,.20), transparent 30%),
        #0f172a;
}

.mobile-admin{
    width:100%;
    max-width:480px;
    margin:0 auto;
    padding:14px;
    padding-bottom:90px;
}

.glass-header{
    background:rgba(255,255,255,.12);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,.18);
    border-radius:28px;
    padding:20px;
    color:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 20px 45px rgba(0,0,0,.28);
}

.glass-header h1{
    margin:3px 0 0;
    font-size:25px;
    letter-spacing:-.5px;
}

.mini-title{
    display:block;
    font-size:10px;
    letter-spacing:1.4px;
    color:#93c5fd;
    font-weight:800;
}

.logout-chip{
    background:rgba(255,255,255,.16);
    color:#fff;
    padding:10px 14px;
    border-radius:999px;
    font-size:13px;
}

.bottom-tabs{
    position:fixed;
    bottom:14px;
    left:50%;
    transform:translateX(-50%);
    width:calc(100% - 28px);
    max-width:460px;
    background:rgba(15,23,42,.88);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,.15);
    border-radius:24px;
    padding:8px;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
    z-index:50;
    box-shadow:0 20px 45px rgba(0,0,0,.35);
}

.bottom-tabs a{
    color:#cbd5e1;
    text-align:center;
    padding:11px 4px;
    border-radius:17px;
    font-size:13px;
    font-weight:800;
}

.bottom-tabs a.active{
    background:#fff;
    color:#0f172a;
}

.dash-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin:14px 0;
}

.dash-grid.three{
    grid-template-columns:repeat(3,1fr);
}

.dash-card{
    background:#fff;
    border-radius:24px;
    padding:16px;
    min-height:104px;
    box-shadow:0 14px 30px rgba(0,0,0,.16);
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.dash-card span{
    color:#64748b;
    font-size:12px;
    font-weight:800;
}

.dash-card strong{
    color:#0f172a;
    font-size:31px;
    line-height:1;
}

.dash-card.dark{
    background:#111827;
}

.dash-card.dark span,
.dash-card.dark strong{
    color:#fff;
}

.dash-card.green strong{
    color:#16a34a;
}

.dash-card.red strong{
    color:#ef4444;
}

.dash-card.blue strong{
    color:#2563eb;
}

.content-section{
    margin-top:12px;
}

.section-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:16px 4px 10px;
}

.section-title h2{
    margin:0;
    color:#fff;
    font-size:20px;
}

.pretty-card,
.code-pretty-card,
.create-panel,
.empty-pretty{
    background:rgba(255,255,255,.96);
    border-radius:28px;
    padding:16px;
    margin-bottom:12px;
    box-shadow:0 16px 35px rgba(0,0,0,.18);
    border:1px solid rgba(255,255,255,.8);
}

.pretty-top,
.code-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.pretty-avatar{
    width:52px;
    height:52px;
    border-radius:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#2563eb,#06b6d4);
    color:#fff;
    font-size:22px;
    font-weight:900;
    flex-shrink:0;
}

.pretty-info{
    flex:1;
}

.pretty-info h3,
.code-head h3{
    margin:0;
    color:#0f172a;
    font-size:17px;
}

.code-head h3{
    direction:ltr;
    background:#0f172a;
    color:#fff;
    padding:10px 12px;
    border-radius:16px;
    letter-spacing:1px;
    word-break:break-all;
}

.pretty-info p{
    margin:4px 0 0;
    color:#64748b;
    font-size:12px;
}

.status-badge{
    border-radius:999px;
    padding:7px 10px;
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
}

.status-badge.green{
    background:#dcfce7;
    color:#166534;
}

.status-badge.red{
    background:#fee2e2;
    color:#991b1b;
}

.status-badge.blue{
    background:#dbeafe;
    color:#1d4ed8;
}

.pretty-details{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    margin-top:14px;
}

.pretty-details div{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:18px;
    padding:10px 12px;
}

.pretty-details small{
    display:block;
    color:#64748b;
    font-size:11px;
    margin-bottom:3px;
}

.pretty-details strong{
    color:#0f172a;
    font-size:13px;
    word-break:break-all;
}

.pretty-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
    margin-top:14px;
}

.pretty-actions a,
.pretty-actions button{
    min-height:46px;
    border:none;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    font-weight:900;
    cursor:pointer;
    margin:0;
}

.btn-soft{
    background:#e0f2fe !important;
    color:#075985 !important;
}

.btn-danger{
    background:#fee2e2 !important;
    color:#991b1b !important;
}

.create-panel{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.create-panel h2{
    margin:0;
    font-size:18px;
    color:#0f172a;
}

.create-panel p{
    margin:5px 0 0;
    color:#64748b;
    font-size:12px;
}

.create-panel form{
    margin:0;
}

.create-panel button{
    width:auto;
    min-height:48px;
    padding:0 18px;
    margin:0;
    border:0;
    border-radius:18px;
    background:#16a34a;
    color:#fff;
    font-weight:900;
}

.empty-pretty{
    color:#64748b;
    text-align:center;
    font-weight:800;
}

/* توافق مع صفحات قديمة لو بقيت */
.approved{
    background:#dcfce7 !important;
    color:#166534 !important;
}

.expired{
    background:#fee2e2 !important;
    color:#991b1b !important;
}

.pending{
    background:#fef3c7 !important;
    color:#92400e !important;
}

.user-card{
    background:#f9fafb;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:11px;
    margin-bottom:10px;
}

.user-actions{
    display:flex;
    gap:8px;
}

.user-actions a{
    background:#111827;
    color:#fff;
    padding:8px 10px;
    border-radius:10px;
    font-size:12px;
}

.user-actions .danger{
    background:#dc2626;
}

@media(max-width:380px){
    .mobile-admin{
        padding:10px;
        padding-bottom:86px;
    }

    .glass-header{
        border-radius:24px;
        padding:16px;
    }

    .glass-header h1{
        font-size:22px;
    }

    .dash-card{
        min-height:92px;
        padding:14px;
    }

    .dash-card strong{
        font-size:27px;
    }

    .pretty-card,
    .code-pretty-card,
    .create-panel{
        border-radius:24px;
        padding:14px;
    }

    .dash-grid.three{
        grid-template-columns:1fr;
    }

    .pretty-actions{
        grid-template-columns:1fr;
    }
}

@media(max-width:360px){
    .frame{
        padding:6px;
    }

    .app{
        border-radius:22px;
        padding:9px;
    }

    .header{
        font-size:17px;
    }

    .day{
        font-size:7px;
        padding:2px;
        border-radius:8px;
    }

    .label{
        font-size:6px;
    }

    .weekdays div{
        font-size:7px;
    }
}
.admin-page{
    margin:0 !important;
    background:#0f172a !important;
    font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    direction:rtl;
}

.admin-app{
    width:100%;
    max-width:430px;
    margin:0 auto;
    padding:14px;
    padding-bottom:30px;
}

.admin-header{
    background:linear-gradient(135deg,#1e293b,#020617);
    color:#fff;
    border-radius:24px;
    padding:18px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 15px 35px rgba(0,0,0,.35);
}

.admin-header small{
    color:#93c5fd;
    font-weight:800;
    font-size:12px;
}

.admin-header h1{
    margin:4px 0 0;
    font-size:28px;
}

.admin-header a{
    background:#fff;
    color:#0f172a;
    padding:10px 14px;
    border-radius:999px;
    font-size:13px;
    text-decoration:none;
    font-weight:900;
}

.admin-menu{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
    margin:12px 0;
    background:#111827;
    padding:8px;
    border-radius:20px;
}

.admin-menu a{
    text-align:center;
    color:#cbd5e1;
    padding:11px 5px;
    border-radius:15px;
    text-decoration:none;
    font-size:13px;
    font-weight:900;
}

.admin-menu a.active{
    background:#fff;
    color:#0f172a;
}

.admin-stats{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin-bottom:16px;
}

.admin-stats div{
    background:#fff;
    border-radius:20px;
    padding:15px;
    box-shadow:0 10px 25px rgba(0,0,0,.18);
}

.admin-stats span{
    display:block;
    color:#64748b;
    font-size:12px;
    font-weight:800;
}

.admin-stats b{
    display:block;
    color:#0f172a;
    font-size:30px;
    margin-top:6px;
}

.admin-title{
    color:#fff;
    font-size:20px;
    margin:18px 4px 10px;
}

.admin-card{
    background:#fff;
    border-radius:24px;
    padding:14px;
    margin-bottom:12px;
    box-shadow:0 14px 32px rgba(0,0,0,.22);
}

.card-top{
    display:flex;
    align-items:center;
    gap:12px;
}

.avatar{
    width:50px;
    height:50px;
    border-radius:18px;
    background:linear-gradient(135deg,#2563eb,#06b6d4);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    font-weight:900;
    flex-shrink:0;
}

.user-info{
    flex:1;
    min-width:0;
}

.user-info h3{
    margin:0;
    color:#0f172a;
    font-size:18px;
    word-break:break-word;
}

.user-info p{
    margin:4px 0 0;
    color:#64748b;
    font-size:12px;
}

.badge{
    padding:7px 10px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
}

.badge.green{
    background:#dcfce7;
    color:#166534;
}

.badge.red{
    background:#fee2e2;
    color:#991b1b;
}

.badge.blue{
    background:#dbeafe;
    color:#1d4ed8;
}

.card-details{
    margin-top:12px;
    display:grid;
    gap:8px;
}

.card-details div{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:16px;
    padding:10px;
}

.card-details small{
    display:block;
    color:#64748b;
    font-size:11px;
    margin-bottom:3px;
}

.card-details b{
    color:#0f172a;
    font-size:13px;
    word-break:break-all;
}

.card-actions{
    margin-top:12px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}

.card-actions a{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    border-radius:16px;
    background:#e0f2fe;
    color:#075985;
    text-decoration:none;
    font-weight:900;
}

.card-actions a.delete{
    background:#fee2e2;
    color:#991b1b;
}