/* ==============================
   EXPIRY ALERT PRO - FINAL CSS
   Premium Side Layout + Matching Height
============================== */

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

:root{
    --bg-card:rgba(255,255,255,0.08);
    --bg-card-strong:rgba(255,255,255,0.12);
    --border:rgba(255,255,255,0.14);
    --text-main:#f8fafc;
    --text-muted:#94a3b8;
    --text-soft:#cbd5e1;

    --primary:#38bdf8;
    --primary-dark:#0284c7;
    --green:#22c55e;
    --yellow:#facc15;
    --red:#ef4444;
    --purple:#a855f7;

    --shadow:0 24px 80px rgba(0,0,0,0.35);
    --radius:22px;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Inter',sans-serif;
}

html{
    scroll-behavior:smooth;
}

body{
    min-height:100vh;
    background:
        radial-gradient(circle at top left, rgba(56,189,248,0.20), transparent 35%),
        radial-gradient(circle at 80% 20%, rgba(168,85,247,0.18), transparent 35%),
        radial-gradient(circle at 58% 88%, rgba(34,197,94,0.20), transparent 32%),
        linear-gradient(135deg, #020617, #07111f 45%, #0f172a);
    color:var(--text-main);
    overflow-x:hidden;
}

/* Background Shapes */
.bg-shape{
    position:fixed;
    border-radius:999px;
    filter:blur(70px);
    opacity:0.45;
    z-index:-1;
}

.shape-one{
    width:280px;
    height:280px;
    background:#38bdf8;
    top:7%;
    left:18%;
}

.shape-two{
    width:320px;
    height:320px;
    background:#a855f7;
    right:8%;
    top:22%;
}

.shape-three{
    width:300px;
    height:300px;
    background:#22c55e;
    left:48%;
    bottom:4%;
}

/* Layout */
.app-wrapper{
    width:100%;
    min-height:100vh;
    display:flex;
}

/* Sidebar */
.sidebar{
    width:235px;
    min-height:100vh;
    padding:22px 18px;
    background:rgba(2,6,23,0.74);
    backdrop-filter:blur(28px);
    border-right:1px solid var(--border);
    position:fixed;
    left:0;
    top:0;
}

.logo-box{
    display:flex;
    align-items:center;
    gap:11px;
    margin-bottom:34px;
}

.logo-icon{
    width:46px;
    height:46px;
    border-radius:16px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg, var(--primary), var(--purple));
    box-shadow:0 14px 30px rgba(56,189,248,0.25);
}

.logo-icon i{
    font-size:22px;
    color:white;
}

.logo-box h2{
    font-size:20px;
    font-weight:900;
    letter-spacing:-0.6px;
}

.logo-box p{
    color:var(--text-muted);
    font-size:12px;
    margin-top:3px;
}

.nav-menu{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.nav-menu a{
    text-decoration:none;
    color:var(--text-soft);
    padding:13px 14px;
    border-radius:16px;
    display:flex;
    align-items:center;
    gap:11px;
    font-size:14px;
    font-weight:700;
    transition:0.25s ease;
}

.nav-menu a i{
    width:18px;
    color:var(--primary);
}

.nav-menu a:hover,
.nav-menu a.active{
    background:rgba(56,189,248,0.13);
    color:white;
    transform:translateX(4px);
}

.sidebar-note{
    position:absolute;
    left:14px;
    right:14px;
    bottom:22px;
    padding:16px;
    border-radius:20px;
    background:rgba(56,189,248,0.10);
    border:1px solid rgba(56,189,248,0.22);
}

.sidebar-note i{
    color:var(--primary);
    margin-bottom:10px;
}

.sidebar-note p{
    font-size:12.5px;
    line-height:1.65;
    color:var(--text-soft);
}

/* Main */
.main-content{
    width:calc(100% - 235px);
    margin-left:235px;
    padding:28px 24px;
    overflow-x:hidden;
}

/* Header */
.top-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:22px;
    margin-bottom:24px;
}

.mini-title{
    color:var(--primary);
    font-size:13px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:1.7px;
    margin-bottom:8px;
}

.top-header h1{
    font-size:43px;
    line-height:1.1;
    letter-spacing:-1.7px;
    font-weight:900;
    background:linear-gradient(90deg, #ffffff, #bae6fd, #d8b4fe);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}

.header-text{
    color:var(--text-muted);
    margin-top:10px;
    max-width:650px;
    line-height:1.6;
}

.header-actions{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

/* Buttons */
button{
    border:none;
    outline:none;
    cursor:pointer;
    font-weight:800;
    transition:0.25s ease;
}

.primary-btn,
.secondary-btn,
.danger-outline-btn{
    padding:13px 18px;
    border-radius:15px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    font-size:14px;
}

.primary-btn{
    background:linear-gradient(135deg, var(--primary), var(--primary-dark));
    color:white;
    box-shadow:0 15px 35px rgba(56,189,248,0.25);
}

.primary-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 18px 40px rgba(56,189,248,0.35);
}

.secondary-btn{
    background:rgba(255,255,255,0.10);
    color:var(--text-main);
    border:1px solid var(--border);
}

.secondary-btn:hover{
    background:rgba(255,255,255,0.16);
    transform:translateY(-2px);
}

.danger-outline-btn{
    background:rgba(239,68,68,0.10);
    color:#fecaca;
    border:1px solid rgba(239,68,68,0.35);
}

.danger-outline-btn:hover{
    background:rgba(239,68,68,0.20);
    transform:translateY(-2px);
}

/* Info Strip */
.info-strip{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:16px;
    margin-bottom:22px;
}

.info-strip div{
    padding:18px 20px;
    border-radius:var(--radius);
    background:var(--bg-card);
    border:1px solid var(--border);
    backdrop-filter:blur(24px);
}

.info-strip span{
    display:block;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
    color:var(--text-muted);
    font-weight:900;
    margin-bottom:7px;
}

.info-strip strong{
    font-size:15px;
    color:white;
}

/* Stats */
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:18px;
    margin-bottom:22px;
}

.stat-card{
    padding:22px;
    border-radius:var(--radius);
    background:var(--bg-card);
    border:1px solid var(--border);
    backdrop-filter:blur(24px);
    display:flex;
    align-items:center;
    gap:16px;
    box-shadow:var(--shadow);
    transition:0.25s ease;
}

.stat-card:hover{
    transform:translateY(-5px);
    background:var(--bg-card-strong);
}

.stat-icon{
    width:54px;
    height:54px;
    border-radius:18px;
    display:grid;
    place-items:center;
    font-size:22px;
}

.stat-icon.total{
    background:rgba(56,189,248,0.15);
    color:var(--primary);
}

.stat-icon.active{
    background:rgba(34,197,94,0.15);
    color:var(--green);
}

.stat-icon.soon{
    background:rgba(250,204,21,0.16);
    color:var(--yellow);
}

.stat-icon.expired{
    background:rgba(239,68,68,0.15);
    color:var(--red);
}

.stat-card p{
    color:var(--text-muted);
    font-size:14px;
    font-weight:700;
}

.stat-card h2{
    font-size:32px;
    margin-top:4px;
}

/* Dashboard Layout */
.dashboard-layout{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 300px;
    gap:18px;
    align-items:stretch;
}

/* Panels */
.records-panel,
.renewal-panel{
    border-radius:var(--radius);
    background:rgba(15,23,42,0.74);
    border:1px solid var(--border);
    backdrop-filter:blur(28px);
    box-shadow:var(--shadow);
}

.records-panel{
    padding:20px;
    min-width:0;
    min-height:650px;
    display:flex;
    flex-direction:column;
}

.renewal-panel{
    width:300px;
    padding:18px;
    min-height:650px;
    position:sticky;
    top:24px;
}

.panel-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
}

.panel-header h2{
    font-size:22px;
    font-weight:900;
    letter-spacing:-0.5px;
}

.renewal-panel .panel-header h2{
    font-size:20px;
}

.panel-header p{
    color:var(--text-muted);
    font-size:14px;
    margin-top:5px;
}

/* Filters */
.filters-row{
    display:grid;
    grid-template-columns:minmax(220px, 1fr) 140px 190px 145px;
    gap:10px;
    margin-bottom:18px;
}

.search-box{
    position:relative;
    min-width:0;
}

.search-box i{
    position:absolute;
    top:50%;
    left:15px;
    transform:translateY(-50%);
    color:var(--text-muted);
}

input,
select{
    width:100%;
    min-width:0;
    padding:13px 13px;
    border-radius:15px;
    border:1px solid var(--border);
    outline:none;
    background:rgba(2,6,23,0.55);
    color:white;
    font-size:13px;
    transition:0.25s ease;
}

.search-box input{
    padding-left:42px;
}

input::placeholder{
    color:#64748b;
}

input:focus,
select:focus{
    border-color:rgba(56,189,248,0.75);
    box-shadow:0 0 0 4px rgba(56,189,248,0.12);
}

select option{
    background:#0f172a;
    color:white;
}

/* Table */
.table-wrapper{
    width:100%;
    overflow-x:hidden;
    border-radius:18px;
    border:1px solid rgba(255,255,255,0.10);
    position:relative;
    flex:1;
}

table{
    width:100%;
    min-width:0;
    table-layout:fixed;
    border-collapse:collapse;
}

thead{
    background:rgba(255,255,255,0.07);
}

th{
    text-align:left;
    padding:15px 10px;
    color:#e2e8f0;
    font-size:11.5px;
    text-transform:uppercase;
    letter-spacing:0.8px;
    white-space:normal;
    word-break:break-word;
}

td{
    padding:18px 10px;
    border-top:1px solid rgba(255,255,255,0.08);
    color:var(--text-soft);
    font-size:13px;
    vertical-align:middle;
    white-space:normal;
    word-break:break-word;
}

tbody tr{
    min-height:86px;
    transition:0.2s ease;
}

tbody tr:hover{
    background:rgba(255,255,255,0.05);
}

/* Column Width */
th:nth-child(1),
td:nth-child(1){
    width:24%;
}

th:nth-child(2),
td:nth-child(2){
    width:15%;
}

th:nth-child(3),
td:nth-child(3){
    width:13%;
}

th:nth-child(4),
td:nth-child(4){
    width:12%;
}

th:nth-child(5),
td:nth-child(5){
    width:14%;
}

th:nth-child(6),
td:nth-child(6){
    width:10%;
}

th:nth-child(7),
td:nth-child(7){
    width:12%;
}

/* Record Text */
.record-title{
    display:flex;
    flex-direction:column;
    gap:5px;
}

.record-title strong{
    color:white;
    font-size:13.5px;
    line-height:1.35;
    font-weight:900;
}

.record-title span{
    color:var(--text-muted);
    font-size:11.6px;
    max-width:100%;
    white-space:normal;
    overflow:hidden;
    text-overflow:ellipsis;
    line-height:1.45;
}

/* Badges */
.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
}

.badge.active{
    color:#bbf7d0;
    background:rgba(34,197,94,0.15);
    border:1px solid rgba(34,197,94,0.25);
}

.badge.soon{
    color:#fef08a;
    background:rgba(250,204,21,0.14);
    border:1px solid rgba(250,204,21,0.25);
}

.badge.expired{
    color:#fecaca;
    background:rgba(239,68,68,0.14);
    border:1px solid rgba(239,68,68,0.28);
}

/* Priority */
.priority{
    display:inline-flex;
    align-items:center;
    gap:5px;
    font-size:12px;
    font-weight:900;
    white-space:nowrap;
}

.priority::before{
    content:"";
    width:8px;
    height:8px;
    border-radius:50%;
    flex-shrink:0;
}

.priority.high{
    color:#fecaca;
}

.priority.high::before{
    background:var(--red);
}

.priority.medium{
    color:#fde68a;
}

.priority.medium::before{
    background:var(--yellow);
}

.priority.low{
    color:#bbf7d0;
}

.priority.low::before{
    background:var(--green);
}

/* Actions */
.action-buttons{
    display:flex;
    align-items:center;
    gap:5px;
    flex-wrap:nowrap;
}

.icon-btn{
    width:30px;
    height:30px;
    border-radius:10px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,0.08);
    color:white;
    border:1px solid rgba(255,255,255,0.10);
    font-size:12px;
    flex-shrink:0;
}

.icon-btn:hover{
    transform:translateY(-2px);
    background:rgba(56,189,248,0.18);
    color:#bae6fd;
}

.icon-btn.delete:hover{
    background:rgba(239,68,68,0.18);
    color:#fecaca;
}

/* Empty State */
.empty-state{
    display:none;
    text-align:center;
    padding:55px 20px;
}

.empty-state i{
    font-size:44px;
    color:var(--primary);
    margin-bottom:15px;
}

.empty-state h3{
    font-size:22px;
    margin-bottom:8px;
}

.empty-state p{
    color:var(--text-muted);
}

/* Renewal Panel */
.renewal-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.renewal-item{
    padding:13px;
    border-radius:18px;
    background:rgba(255,255,255,0.07);
    border:1px solid rgba(255,255,255,0.10);
    transition:0.25s ease;
}

.renewal-item:hover{
    transform:translateY(-3px);
    background:rgba(255,255,255,0.11);
}

.renewal-top{
    display:flex;
    justify-content:space-between;
    gap:10px;
    margin-bottom:9px;
}

.renewal-top strong{
    font-size:13px;
    color:white;
    line-height:1.35;
    font-weight:900;
}

.days-left{
    font-size:11px;
    font-weight:900;
    padding:5px 8px;
    border-radius:999px;
    white-space:nowrap;
    height:max-content;
}

.days-left.safe{
    color:#bbf7d0;
    background:rgba(34,197,94,0.14);
}

.days-left.warn{
    color:#fef08a;
    background:rgba(250,204,21,0.14);
}

.days-left.danger{
    color:#fecaca;
    background:rgba(239,68,68,0.14);
}

.renewal-meta{
    color:var(--text-muted);
    font-size:12px;
    line-height:1.55;
}

.no-renewal{
    padding:22px;
    text-align:center;
    color:var(--text-muted);
    border:1px dashed rgba(255,255,255,0.18);
    border-radius:18px;
}

/* Modal */
.modal-overlay{
    position:fixed;
    inset:0;
    display:none;
    align-items:center;
    justify-content:center;
    background:rgba(2,6,23,0.78);
    backdrop-filter:blur(18px);
    z-index:100;
    padding:20px;
}

.modal-overlay.show{
    display:flex;
}

.modal-box{
    width:100%;
    max-width:760px;
    border-radius:26px;
    background:linear-gradient(145deg, rgba(15,23,42,0.98), rgba(30,41,59,0.96));
    border:1px solid rgba(255,255,255,0.16);
    box-shadow:0 30px 100px rgba(0,0,0,0.55);
    padding:24px;
    animation:modalPop 0.25s ease;
}

@keyframes modalPop{
    from{
        opacity:0;
        transform:translateY(20px) scale(0.96);
    }
    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}

.modal-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:22px;
}

.modal-header h2{
    font-size:24px;
    font-weight:900;
}

.modal-header p{
    color:var(--text-muted);
    margin-top:5px;
    font-size:14px;
}

.close-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    background:rgba(255,255,255,0.08);
    color:white;
    border:1px solid rgba(255,255,255,0.12);
    font-size:18px;
}

.close-btn:hover{
    background:rgba(239,68,68,0.18);
    color:#fecaca;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:16px;
}

.form-group label{
    display:block;
    color:#e2e8f0;
    font-size:13px;
    font-weight:800;
    margin-bottom:8px;
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:24px;
}

/* Toast */
.toast{
    position:fixed;
    right:28px;
    bottom:28px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:15px 18px;
    border-radius:16px;
    background:rgba(15,23,42,0.96);
    border:1px solid rgba(34,197,94,0.35);
    color:white;
    box-shadow:0 18px 50px rgba(0,0,0,0.35);
    transform:translateY(120px);
    opacity:0;
    pointer-events:none;
    transition:0.35s ease;
    z-index:200;
}

.toast.show{
    transform:translateY(0);
    opacity:1;
}

.toast i{
    color:var(--green);
}

/* Responsive */
@media(max-width:1200px){
    .dashboard-layout{
        grid-template-columns:1fr;
    }

    .renewal-panel{
        width:100%;
        position:relative;
        top:0;
        min-height:auto;
    }

    .records-panel{
        min-height:auto;
    }

    .renewal-list{
        display:grid;
        grid-template-columns:repeat(3, 1fr);
        gap:14px;
    }

    .table-wrapper{
        overflow-x:auto;
    }

    table{
        min-width:820px;
    }
}

@media(max-width:900px){
    .app-wrapper{
        flex-direction:column;
    }

    .sidebar{
        position:relative;
        width:100%;
        min-height:auto;
    }

    .sidebar-note{
        position:relative;
        left:auto;
        right:auto;
        bottom:auto;
        margin-top:22px;
    }

    .main-content{
        width:100%;
        margin-left:0;
        padding:22px;
    }

    .top-header{
        flex-direction:column;
    }

    .header-actions{
        justify-content:flex-start;
    }

    .stats-grid{
        grid-template-columns:repeat(2, 1fr);
    }

    .info-strip{
        grid-template-columns:1fr;
    }

    .filters-row{
        grid-template-columns:1fr 1fr;
    }

    .top-header h1{
        font-size:36px;
    }

    .renewal-list{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media(max-width:640px){
    .main-content{
        padding:16px;
    }

    .sidebar{
        padding:20px;
    }

    .stats-grid{
        grid-template-columns:1fr;
    }

    .filters-row{
        grid-template-columns:1fr;
    }

    .renewal-list{
        grid-template-columns:1fr;
    }

    .form-grid{
        grid-template-columns:1fr;
    }

    .modal-actions{
        flex-direction:column;
    }

    .primary-btn,
    .secondary-btn,
    .danger-outline-btn{
        width:100%;
    }

    .top-header h1{
        font-size:32px;
    }
}