/* ==== GLOBAL ==== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
    transition: background 0.3s ease, color 0.3s ease, filter 0.3s ease;
}

body {
    display: flex;
    min-height: 100vh;
    background: #f5f6fa;
    color: #36454F;
}

a {
    color: #ea580c;
    text-decoration: none;
}

button {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background: #2f3640;
}

.dashboard {
    display: flex;
    width: 100%;
    position: relative;
}

/* ==== OVERLAY ==== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1500;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==== SIDEBAR ==== */

.sidebar {
    width: 250px;
    background: #2f3640;
    color: #fff;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 2000;
}

.sidebar h2 {
    font-size: 1.2rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    margin-bottom: 0;
    padding: 0;
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin: 8px 0;
}

.sidebar ul li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.3s;
}

.sidebar ul li a:hover {
    background: #556D7C;
}

.sidebar ul li a.active {
    background: #EA580C;
    font-weight: bold;
}

/* ==== MAIN CONTENT ==== */

.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
}

.main-content.blurred {
    filter: blur(5px) brightness(0.7);
    transition: filter 0.3s ease;
}

/* ==== NAVBAR ==== */

.navbar {
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle,
.toggle-btn {
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: inherit;
}

/* ==== PAGE HEADER ==== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
}

/* ==== CONTENT ==== */

.content {
    padding: 20px;
    flex: 1;
}

.grid-container {
    display: grid;
    grid-template-columns: 0.5fr 0.5fr;
    gap: 20px;
}

.grid-container-3 {
    display: grid;
    grid-template-columns: 0.33fr 0.33fr 0.33fr;
    gap: 20px;
}

.card {
    background: #fff;
    color: #36454F;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
    transition: box-shadow 0.25s ease, transform 0.25s ease-in-out;
}

.card:hover {
    box-shadow: 0 2px 5px rgba(250,145,0,0.5);
    outline: none;
}

.card div {
    margin-bottom: 10px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 10px;
}

.card ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.card ul li {
    padding-left: 10px;
}

.card button {
    margin-bottom: 20px;
}

/* ==== FORM BASE STYLE ==== */

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #36454F;
}

/* ==== INPUTS, TEXTAREA, SELECT ==== */

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #36454F;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 2px #fa9100;
    outline: none;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #fa9100;
    box-shadow: 0 0 0 2px #fa9100;
    outline: none;
}

::placeholder {
    color: #999;
}

/* ==== INPUT DATE & TIME ==== */

input[type="date"],
input[type="time"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #36454F;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(40%);
    cursor: pointer;
}

/* ==== CHECKBOXES & RADIOS ==== */

input[type="checkbox"],
input[type="radio"] {
    accent-color: #4285F4;
    transform: scale(1.1);
    cursor: pointer;
}

/* ==== DISABLED STATE FOR INPUTS ==== */

input[disabled],
input[type="date"][disabled],
input[type="time"][disabled],
input[type="number"][disabled],
input[type="email"][disabled],
input[type="password"][disabled],
input[type="text"][disabled],
select[disabled],
textarea[disabled] {
    background: #f0f0f0;
    color: #36454F;
    border: 1px solid #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

input[disabled]::placeholder,
textarea[disabled]::placeholder {
    color: #aaa;
}

input[disabled]:hover,
select[disabled]:hover,
textarea[disabled]:hover {
    border-color: #ccc;
    box-shadow: none;
}

input[type="submit"] {
    background: #4285F4;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

input[type="submit"]:hover {
    background: #74b9ff;
}

/* ==== FOOTER ==== */

.footer {
    font-size: small;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
}

/* ==== TOAST CONTAINER ==== */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

/* ==== BASE TOAST STYLE ==== */

.toast {
    background: #fff;
    color: #36454F;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 12px 16px;
    min-width: 260px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* ==== TOAST TYPES ==== */

.toast-success {
    background: #00A351;
    color: #fff;
}

.toast-failed {
    background: #A30000;
    color: #fff;
}

.toast-warning {
    background: #A3A300;
    color: #fff;
}

.toast-info {
    background: #0051A3;
    color: #fff;
}

/* Toast message + timestamp */

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-time {
    font-size: 0.7rem;
    color: #fff;
    margin-top: 4px;
    text-align: left;
}

/* ==== OTHER ==== */

.maxw-600 {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.h-75 {
    height: 75px;
}

.ta-right {
    text-align: right;
}

.ta-left {
    text-align: left;
}

.ta-center {
    text-align: center;
}

.bd-bottom {
    border-bottom: 1px solid #ccc;
}

.pb-20 {
    padding-bottom: 20px;
}

.pb-10 {
    padding-bottom: 10px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-0 {
    margin-bottom: 0;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.bold {
    font-weight: bold;
}

.bg-red {
    background: #EA4335;
}

.bg-green {
    background: #34A853;
}

.bg-blue {
    background: #4285F4;
}

.bg-yellow {
    background: #fa9100;
}

.bg-white {
    background: #fff;
}

.bg-dark {
    background: #36454F;
}

.text-red {
    color: #EA4335;
}

.text-green {
    color: #34A853;
}

.text-blue {
    color: #4285F4;
}

.text-yellow {
    color: #fa9100;
}

.text-white {
    color: #fff;
}

.text-dark {
    color: #36454F;
}

.badge {
    font-size: small;
    padding: 3px 6px;
    border-radius: 6px;
}

.captcha {
    display: inline-block;
    padding: 3px 6px;
    background: #fa9100;
    font-family: "Courier New", monospace;
    letter-spacing: 3px;
    text-shadow: 1px 1px #fff;
    user-select: none;
}

/* ==== LOADING SPINNER ==== */

.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spinner-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #ea580c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==== DARK MODE ==== */

body.dark-mode {
    background: #1e272e;
    color: #f1f2f6;
}

body.dark-mode .card {
    background: #2f3640;
    color: #f1f2f6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .card:hover {
    box-shadow: 0 2px 5px rgba(250,145,0,0.5);
    outline: none;
}

body.dark-mode .footer,
body.dark-mode .navbar {
    background: #2f3640;
    color: #f1f2f6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body.dark-mode .overlay {
    background: rgba(0, 0, 0, 0.5);
}

body.dark-mode label {
    color: #f1f2f6;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #2f3640;
    color: #fa9100;
    border: 1px solid #555;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(85%);
}

body.dark-mode input[disabled],
body.dark-mode select[disabled],
body.dark-mode textarea[disabled] {
    background: #3a3f47;
    color: #fa9100;
    border: 1px solid #666;
    opacity: 0.6;
    cursor: not-allowed;
}

body.dark-mode input[disabled]::placeholder,
body.dark-mode textarea[disabled]::placeholder {
    color: #777;
}

body.dark-mode input[type="submit"] {
    background: #00a8ff;
    color: #fff;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .grid-container-3 {
        grid-template-columns: 1fr;
    }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .close-btn {
        display: block;
    }
}

/* Fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}