/* =========================
   RESET & BASE
========================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #C8EEF8;
}

/* Flex layout */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Prevent footer overlap */
main {
    flex: 1;
    display: block;
    padding-bottom: 90px;
}

/* =========================
   HEADER
========================= */
header {
    text-align: center;
    padding: 20px 0;
}

.logo {
    width: 350px;
    max-width: 80%;
    margin: 0 auto 20px;
    display: block;
}

/* =========================
   NAVIGATION
========================= */
nav {
    background-color: #333;
    position: relative;
}

.menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.menu li a {
    display: block;
    padding: 12px 18px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s, transform 0.2s;
}

.menu li a:hover {
    background-color: #555;
    transform: scale(1.05);
}

/* Hamburger */
.hamburger {
    display: none;
    font-size: 30px;
    color: white;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

#menu-toggle {
    display: none;
}

/* =========================
   LAYOUT
========================= */
.layout,
.dashboard {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}

.layout main,
.dashboard main {
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #C8EEF8;
    padding: 20px;
    min-height: 100vh;
}

.sidebar ul {
    list-style: none;
}

.sidebar a {
    display: block;
    margin: 10px 0;
    color: black;
    text-decoration: none;
}

/* =========================
   CARD / CONTENT
========================= */
.card {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    max-width: 700px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card h2 {
    margin-bottom: 15px;
}

/* =========================
   FORMS
========================= */
form {
    margin-top: 10px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s ease;
}

form input:focus,
form textarea:focus,
form select:focus {
    border-color: #333;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

input[type="file"] {
    padding: 8px;
    background: #f9f9f9;
    cursor: pointer;
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #000;
    color: #fff;
}

.btn-secondary {
    background-color: #000;
    color: #fff;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn:active {
    transform: translateY(0);
    opacity: 0.8;
}

.btn:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.btn-delete {
    background: #c0392b;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group .btn {
    width: 50%;
}

/* =========================
   LOGIN PAGE
========================= */
.login-page main {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: #C8EEF8;
    padding: 35px;
    width: 350px;
    max-width: 90%;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
}

.extra {
    text-align: center;
    margin-top: 15px;
}

/* =========================
   TABLES
========================= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    border: 1px solid #ccc;
    padding: 10px;
}

.data-table th {
    background: #f4f4f4;
}

/* =========================
   FOOTER (FIXED)
========================= */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    z-index: 1000;
}

/* =========================
   CUSTOM COMPONENTS
========================= */
.welcome-box {
    background: #2c3e50;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.welcome-date {
    font-weight: normal;
    padding-top: 5px;
}

.ticker {
    overflow: hidden;
    background: #A3AABE;
    color: #fff;
    padding: 10px;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: scroll 30s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.table-actions {
    margin-top: 20px;
    text-align: center;
}

.content-area {
    display: block;
}

/* =========================
   PERMISSIONS UI (MERGED)
========================= */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 14px;
}

.permission-item {
    position: relative;
    display: flex;
}

.permission-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permission-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permission-item span:hover {
    border-color: #2c7be5;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.permission-item input:checked + span {
    background: #2c7be5;
    color: #fff;
    border-color: #2c7be5;
}

/* =========================
   TABS
========================= */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab {
    padding: 8px 14px;
    text-decoration: none;
    background: #000;
    border-radius: 6px;
    color: #FFF;
    font-weight: 500;
}

.tab:hover {
    background: #ddd;
    color: #000;
}

.tab.active {
    background: #000;
    color: #fff;
}

/* =========================
   WIDGETS
========================= */
.widget {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.widget-header h3 {
    margin-bottom: 10px;
}

.widget ul {
    list-style: none;
}

.bookmark-list li {
    margin-bottom: 8px;
}

.bookmark-list a {
    text-decoration: none;
    color: #007bff;
}

.widget-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* =========================
   TASKS
========================= */
.task-list {
    list-style: none;
}

.task-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.task-desc {
    font-size: 12px;
    color: #666;
}

.task-date {
    font-size: 11px;
}

.task-red { color: #c0392b; font-weight: 600; }
.task-orange { color: #e67e22; }
.task-green { color: #27ae60; }

.task-countdown.overdue {
    color: #fff;
    background: #c0392b;
    padding: 3px 6px;
    border-radius: 4px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% { opacity: 0.6; }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .menu {
        flex-direction: column;
        display: none;
        width: 100%;
    }

    #menu-toggle:checked + .hamburger + .menu {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .layout,
    .dashboard {
        flex-direction: column;
        gap: 10px;
    }

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

    main {
        width: 100%;
        padding: 0 10px 90px;
    }

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

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.checkbox-label input {
    width: auto;
}
